My MySQL DB stores and returns numbers with two decimal points, like 4 is 4.00. and 4.9 is 4.90.
But I want to format them in HTML or using javascript such that 4.00 is 4, and 4.90 is 4.9, 4.25 is 4.25 (get rid of the trailing zeros).
How do I do this?
Thanks
UPDATE: (Requirements)
After reading some of the response, I realize I need to provide more info due to the way the server side code returns data. The php returns a JSON string containing the numeric along with many other data, and then it is dumped into a jQuery template, with the following to receive the data
<div class="duration">${duration}</div>