On 11/16/00, Rick Lamb penned:
>I thought this would be simple. How can round a long integer eg: 2.146752 to
>the first decimal point?

That's not an integer. LOL

This is the way I do it:

<cfset number = "2.146752">
<cfset number = round(2.146752 * 10) / 10>

= 2.1

Add another 0 for each decimal you want to round to:

<cfset number = round(2.146752 * 100) / 100>

= 2.15

<cfset number = round(2.146752 * 1000) / 1000>

= 2.147
-- 

Bud Schneehagen - Tropical Web Creations

_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
ColdFusion Solutions / eCommerce Development
[EMAIL PROTECTED]
http://www.twcreations.com/
954.721.3452
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

Reply via email to