| Author |
number formatted is unexpected.
|
nani aman
Ranch Hand
Joined: Sep 22, 2004
Posts: 33
|
|
I have a problem to make the number formatted to 2 points. This is the code i use and i expect to get iQ = 0.13 instead of 0.133 using codes below. What is my syntax arror actually? Could anybody tell me? NumberFormat nf; nf = NumberFormat.getInstance(); nf.setMaximumIntegerDigits(2); nf.setMinimumIntegerDigits(2); String iQ = nf.format(iQuan); System.out.println("iQ :"+iQ); Thanks alot.
|
 |
Barry Higgins
Ranch Hand
Joined: Jun 05, 2003
Posts: 89
|
|
Try using This sets the digits after the decimal point .. you were setting the digits before the decimal point. Regards, Barry
|
 |
 |
|
|
subject: number formatted is unexpected.
|
|
|