Currently, using DecimalFormat I would like to show maximum number of decimal places, or don't show at all. For instance,
- 100.0 shown as "100"
- 100.123 shown as "100.123"
- 100.123456789012345 shown as "100.123456789012345" Using format as
new DecimalFormat("0.###"); is partially correct. It works for 1st case, 2nd case but not 3rd case. As, I have no idea how much # should I have?
So, may I know what is the correct DecimalFormat I should use?