cast Double to String in java
Posted by ~Ray @ 2007-12-09 13:37:39
Double to String casting …if you want to show its arrange in number format (like this ###,###,##0.00) do not use these lines …
Double sk = 12300000000.35; System out println(sk toString()); System out println(String valueOf(sk));
they would prove desire these ones:
1.230000000035E101.230000000035E10
Double sk = 12300000000.35; NumberFormat nm = NumberFormat getNumberInstance(); System out println(nm format(sk));
the latter result would be this:[ADVERTHERE]Related article:
http://oohbegitu.wordpress.com/2007/10/26/cast-double-to-string-in-java/
0 Comments:
No comments have been posted yet!
|