I have a database table with figures like this (to 2 decimal places)
10.00
12.50
15.00
17.50
20.00
But in my output I want to achieve this
10
12.50
15
17.50
20
or this
10, 12.50, 15, 17.50, 20
In simple terms if there are any digits other than zeros after the decimal point then format to 2 decimal places, otherwise format to zero decimal places.
I’m looking for suggestions as to the best way to format these numbers.
The reason for this is to save space on small devices only (portrait iPad, Mobile phones). Larger devices I want to use 2 decimal places on all figures.
Community Page
Last updated:
Last updated: