Rouchie
asked on
Trimming a number to 2 decimal places + remove trailing zeros
I'd like to display a numer in the format XXX.XX, but also trim off any trailing zeros that exist in the remaining 2 decimal places.
Can anyone tell me the best way to display this number? I'm going to use the code in a function, that will accept a double value as the input.
i.e.
33.333333 ---> 33.33
25.50 ---> 25.5
50 ---> 50
Can anyone tell me the best way to display this number? I'm going to use the code in a function, that will accept a double value as the input.
i.e.
33.333333 ---> 33.33
25.50 ---> 25.5
50 ---> 50
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks Tim.