Try:
<CFSET TwoDecimals=Round(Float * 100) / 100>
In case the math isn't intuitive:
You take Float (=3.1415926). You multiply it by 100 (=314.15926). You
round it off (=314). You then divide by 100 (=3.14).
You can get any number of decimals using this. If you need it to be
variable:
<CFSET nDecimals="4">
<CFSET Pow10=10 ^ nDecimals>
<CFSET newNum=Round(oldNum * Pow10) / Pow10>
HTH,
-Rick
-----Original Message-----
From: Kim Ahlbrandt [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, August 30, 2000 5:12 PM
To: [EMAIL PROTECTED]
Subject: Rounding to two decimal places
After doing some calculations, I'm coming up with a number (for example)
143.129997919. I would like this to be displayed as 143.13. I have noticed
that there is a function called "round" and a few related functions but
these take away the two decimal places I do want to keep. Can anyone help??
Kim
_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
Share information about yourself, create your own public profile at
http://profiles.msn.com.
----------------------------------------------------------------------------
--
Archives: http://www.mail-archive.com/[email protected]/
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or
send a message to [EMAIL PROTECTED] with 'unsubscribe' in
the body.
------------------------------------------------------------------------------
Archives: http://www.mail-archive.com/[email protected]/
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.