Created
February 23, 2022 19:03
-
-
Save trycf/68f2af2423ae56b15dd75d9bec99bbc5 to your computer and use it in GitHub Desktop.
TryCF Gist
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<cfoutput> | |
<cfset values = [ | |
-2, | |
-1.9, | |
-1.8, | |
-1.7, | |
-1.6, | |
-1.5, | |
-1.4, | |
-1.3, | |
-1.2, | |
-1.1, | |
-1, | |
-0.9, | |
-0.8, | |
-0.7, | |
-0.6, | |
-0.5, | |
-0.4, | |
-0.3, | |
-0.2, | |
-0.1, | |
0, | |
0.1, | |
0.2, | |
0.3, | |
0.4, | |
0.5, | |
0.6, | |
0.7, | |
0.8, | |
0.9, | |
1, | |
1.1, | |
1.2, | |
1.3, | |
1.4, | |
1.5, | |
1.6, | |
1.7, | |
1.8, | |
1.9, | |
2 | |
]> | |
<table border="1" cellspacing="2"> | |
<tr> | |
<th>Number</th> | |
<th>Round</th> | |
<th>Int</th> | |
<th>Ceiling</th> | |
<th>Fix</th> | |
<th>NumberFormat</th> | |
</tr> | |
<cfloop array="#values#" index="num"> | |
<tr> | |
<td>#Num#</td> | |
<td>#Round(Num)#</td> | |
<td>#Int(Num)#</td> | |
<td>#Ceiling(Num)#</td> | |
<td>#Fix(Num)#</td> | |
<td>#NumberFormat(Num,'0')#</td> | |
</tr> | |
</cfloop> | |
</table> | |
</cfoutput> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment