ColdFusion round decimal value

70 Views Asked by At
<cfif (NOT IsNull(nt)) and (NOT IsNull(kt)) >
    <cfset ct= (nt * kt) / 100>
<cfelse>
    <cfset ct= 00.00 >
</cfif>

let nt = 77 and kt = 13. ct will be 10.01.

I want to round the result to be 10.00.

I tried using round(ct), floor(ct).

`floor(62.72)` 
`floor(62.72)` 
`value="#Numberformat(ct,',9.99')#"`

Other scenario : if ct = 12.31, result should be 12.30, if ct = 22.48, result should be 22.48 (Not changed)

1

There are 1 best solutions below

2
Underscore On

You want the Fix function

Fix(10.01) will result in 10