ColdFusion Fix() - How to convert a real number to an integer

Fix() - convert a real number to an integer

Fix.cfm



<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Fix function example: how to convert a real number to an integer</title>
</head>

<body>
<h2 style="color:hotpink">Fix Function Example</h2>

<table style="color:LightGreen; background:Green;" border="1" bordercolor="DarkGreen">
    <tr>
     <td style="font-weight:bold">Fix</td>
     <td style="font-weight:bold">Output</td>
    </tr>
    <tr>
     <td>#Fix(3.6)#</td>
     <td><cfoutput>#Fix(3.6)#</cfoutput></td>
    </tr>
    <tr>
     <td>#Fix(3.1)#</td>
     <td><cfoutput>#Fix(3.1)#</cfoutput></td>
    </tr>
    <tr>
     <td>#Fix(-2.2)#</td>
     <td><cfoutput>#Fix(-2.2)#</cfoutput></td>
    </tr>
    <tr>
     <td>#Fix(5)#</td>
     <td><cfoutput>#Fix(5)#</cfoutput></td>
    </tr>
    <tr>
     <td>#Fix(2.9)#</td>
     <td><cfoutput>#Fix(2.9)#</cfoutput></td>
    </tr>
</table>
</body>
</html>







More ColdFusion examples