Article View: borland.public.jbuilder.java.language
Article #18978Re: Conversions in 1.0.2
From: James D. Frentress
Date: Wed, 18 Mar 1998 00:00
Date: Wed, 18 Mar 1998 00:00
19 lines
1138 bytes
1138 bytes
Exeter wrote:
> Basically I have a database pulling a float (ie. 12.95)
> and I have a text box where I want to enter a number.
> I want to multiply the float by the textbox input and end up with a
> float.
String g = new String("12.95"); // string value retrieved from textbox
float fVal = 10; // value retrieve from database
System.out.println("Text value : " + g);
System.out.println("Database value : " + fVal);
try {
float f = Float.valueOf(g.trim()).floatValue();
fVal *= f;
System.out.println("Multiplied : " + fVal);
} catch (NumberFormatException ex1){}
Jim
Technical Details
Message-ID:
<35105F1B.9CCAB24C@ForAWhile.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<35103222.7A2D@starnetinc.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f74b3,d0d0e184e0974a3 X-Google-Attributes: gidf74b3,public From: "James D. Frentress" <Broken@ForAWhile.com> Subject: Re: Conversions in 1.0.2 Date: 1998/03/18 Message-ID: <35105F1B.9CCAB24C@ForAWhile.com> X-Deja-AN: 335412816 Content-Transfer-Encoding: 7bit References: <35103222.7A2D@starnetinc.com> X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Organization: Microsoft Mime-Version: 1.0 Newsgroups: borland.public.jbuilder.java.language