Remove Trailing Zeroes

When working with currency values, sometimes we need to retain high decimal specificity ie $3.14285 per unit. This is especially valuable when calculating total amounts where there is a high quantity of units at a certain price per unit. For example if you purchase 15,000 units at $3.14285 = 47,142.75.

Whereas if you only retain two decimals you get 15,000 * $3.14 = 47,100. The $42.75 can make a big difference in getting things to value. Sometimes you’ll want to display this value as a text output, but Coda will show the entire value and the convention for the user may be to simply show the two decimal $3.14. Here it is useful for the computer to retain the longer notation and the shorter for the user. In this case we can round the value round(2) however this still will still show as a text value as $3.14000.

To remove the trailing zeroes, you can use the following formula: