🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.language
Article #18929

Re: Conversions in 1.0.2

#18929
From: Clint Brewer
Date: Tue, 07 Apr 1998 00:00
42 lines
1542 bytes
Hello Exter, 

  try something like this:

float  myFloat;
Float mynewFloat = new Float(myfloat); 
Float textFieldFloat = new Float(myTextField.getString());

then you should be able to multiply your mynewFloat and your
textFieldFloat together.  If you need to convert the result back into a
float, I believe there is a function of the Float class like
Float.getFloat()  or Float.toFloat(), if you look in the jdk
documentation, you should see the proper method to use.

hope this helps,
Clint Brewer

Exeter wrote:
> 
> I am building an app in 1.0.2 and cannot seem to figure out  



conversions.
> 
> 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.
> 
> I have tried a ton of variations and keep getting erros like:
> 
> can't convert string to int
> can't convert Float to float
> ...
> 
> Could someone please help?
> 
> Thanks,
> Exeter
Technical Details
Message-ID: <352ABDB6.139E@borland.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <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: Clint Brewer <supportinfo@borland.com>
Subject: Re: Conversions in 1.0.2
Date: 1998/04/07
Message-ID: <352ABDB6.139E@borland.com>
X-Deja-AN: 341874858
Content-Transfer-Encoding: 7bit
References: <35103222.7A2D@starnetinc.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Organization: Borland International
Newsgroups: borland.public.jbuilder.java.language