Power from within.
Failed SCJP 2 times :-(
I'm guessing that NumberFormat.setMaximumFractionDigits can only be applied to numbers. It explicitly says, "Numbers" in the API.
Power from within.
Failed SCJP 2 times :-(
sebastian tortschanoff wrote:
Now my confusion.
* Why does my output looks so different (the colon instead uf a dot and look at the parsed string s)? I'm shure i have not made any typing errors (at least in the code).
* Why is the output of this: 987,12346
i'd expected something like this: 987,12345
I know Life is very Tough...But I AM TOUGHER
SCJP 1.5
Hi sebastian,
the above s.o.p statement will print 987.12346 because in the fractional part the 5th digit is rounding to 6.
as per basic mathematical rule
Power from within.
Failed SCJP 2 times :-(
This concludes, that answer D. can not be a correct answer, cause will not return 987.123456 but simply 987123456.
I know Life is very Tough...But I AM TOUGHER
SCJP 1.5
where you are tested it?? if you tested it under command prompt you will definately get the 987.123456 even your using
view plaincopy to clipboardprint?
1. system.out.println((Number)nf.parse(s));
Power from within.
Failed SCJP 2 times :-(
sebastian tortschanoff wrote:
is always this: 987123456 <-- no delimiters!!!
I know Life is very Tough...But I AM TOUGHER
SCJP 1.5
I think that the way that NumberFormat prints depend on Locale language settings
Power from within.
Failed SCJP 2 times :-(
-getInstance()
Returns the default number format for the current default locale.
Power from within.
Failed SCJP 2 times :-(