convert string to double, and result is string again
Expand Post »
hello
how to convert string to double, and result is string.
example ;
String code =00000000001;
Double plus =code + 1;
String result =plus; // and result is 0000000002
Re: convert string to double, and result is string again
hello,
String s1=new String("0000001");
Double d=new Double(s1);
double d1=d.doubleValue();
s1=d1+"";
if u solve ur problem plz give a reply. i hopw u will solve ur problem by using this simple logic
Re: convert string to double, and result is string again
That or use NumberFormat.
To any sane person (and a computer in that regard is a sane person) the leading zeros are utterly unimportant, a darned nuisance even, and thus stripped and ignored.
None of you except sos realised that apparently. None of you took the trouble to actually look at how numbers are represented in a computer, and thus realised that there are no leading zeros anywhere.
The number is stored as a series of bits representing a number, NOT a string, and a number never has leading zeros.
No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.