Convert float to string

Q

Quinn

I've got this section of code that is working, but the strings that
are returned are not correct.

wload.setText(Convert.toString(wingload));

I think I;m starting with the value of wingload as 21.5, but the
string that is returned is displayed as 2.15. I then put this in
before the convert:

wingload = wingload * 10;

but it still displays as 2.15.

I'm developing this in SuperWaba 3.5a on a Palm 3.5 device with the
Sun j2sdk 1.4.2.

Thanks for any help
 
R

Roedy Green

I think I;m starting with the value of wingload as 21.5, but the
string that is returned is displayed as 2.15. I then put this in
before the convert:

I have not heard of the Convert class before. I proposed it to
replace the hodgepodge of conversion methods. See
http://mindprod.com/converter.html for the classic code to convert to
String that will behave as expected.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,521
Members
44,995
Latest member
PinupduzSap

Latest Threads

Top