http://www.exampledepot.com/egs/java.text/FormatNum.html
i have number 1.23 and i want to format it to 1,23. But if i have just 1 then i do not want format it to 1,00.
With ##,##0.00 i format 1.23 to 1,23 and 1 to 1,00. How can i format 1.23 to 1,23 and 1 to 1.
Try this pattern instead:
##,###.##prints:
The
0in the pattern shows zeros as “0”, while#shows zeros as absent.