formatFloat - how to always show 2 decimal places

1
I am using formatFloat to convert a number to a string as follows: formatFloat($Variable_Number, '$ ##,###,###.##') When the number ends in zero or two zeros, I only get one decimal place or no decimal places in the string. Does anyone know how I can always force 2 decimal places? For instance, 1191.23 results in a string of $ 1,191.23 210.30 results in a string of $ 210.3 9421.00 results in a string of $9,421 In all cases, I would like 2 decimal places, so $1,191.23, $ 210.30, $9,421.00 Thanks.
asked
1 answers
3

Mendix uses the Java DecimalFormat class in the background: http://docs.oracle.com/javase/7/docs/api/java/text/DecimalFormat.html
You can use all paterns described on there.

This page describes for a #: zero shows as absent. That means if you want to show a zero value as 0.00 you would have to use a pattern such as this: "##,###,##0.00"

answered