You can use DecimalFormat() to have two decimal places. Otherwise you can
use NumberFormat(). When using NumberFormat, make sure you leave enough
padding on the left, notice what happens on example 3 if you don't.
<cfset nTest = 5.678>
<cfset nLongTest = 5555555.678>
<cfoutput>
1: #DecimalFormat(nTest)#<br>
2: #NumberFormat(nTest,"_____._")#
3: #NumberFormat(nLongTest,"_____._")#
</cfoutput>
<resultsoutput>
1: 5.68
2: 5.7
3: 5555555
</resultsoutput>
-----Original Message-----
From: Rick Lamb [mailto:[EMAIL PROTECTED]]
Sent: Thursday, November 16, 2000 9:18 AM
To: CF-Talk
Subject: rounding to first decimal
I thought this would be simple. How can round a long integer eg: 2.146752 to
the first decimal point?
Thanks,
Rick
----------------------------------------------------------------------------
--------------------
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists or send a
message with 'unsubscribe' in the body to [EMAIL PROTECTED]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
https://secure.houseoffusion.com
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists