Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to truncate number to 2 decimal places in ColdFusion?

How can I take some variables and output them only to two decimal places, but leave the variables themselves unchanged?

I tried

NumberFormat(reportData, '0,00') 

But the numbers remained the same.

like image 242
blarg Avatar asked Feb 11 '13 12:02

blarg


1 Answers

, is the separator for thousands and 0 stands for "pad with zero", as can be read in the official documentation. Try it like this:

NumberFormat(reportData, '9.99');
like image 92
Till Helge Avatar answered Oct 03 '22 13:10

Till Helge