IMHO, DecimalFormat
is used to format the entire represntation of numbers and controling the count of digits after a number.
So #
and ##
before a decimal (.
) wont behave differently....but would certainly do, if placed after a decimal (.
)
assuming 12.234 as an input number:
12.234 and 12.23 would make sense
but
12.234 and 2.234 would not.
So emphasis is put on format and values after a decimal point like :
setMinimumFractionDigits(0);
setMaximumFractionDigits(2);
setRoundingMode