Thanks for all the help folks - much appreciated.

I've just stumbled across another method to achieve this. I wasn't sure you
could treat a number as a string so using trims etc may not have been
desirable, but this works too.....

<CFSET TruncatedNumber = INT(OriginalValue*1000)/1000>

Depending on how many decimal places you want you just change the 1000.

Thanks again for your help.


+++++++++
Kevin Parker
Service and Communication
WorkCover Corporation

[EMAIL PROTECTED]
www.workcover.com

ph:  +61 8 82332548
fax: +61 8 82332000
mob: 0418 800 287

++++++++++ 

-----Original Message-----
From: Steve Reich [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, 23 May 2000 2:58 PM
To: [EMAIL PROTECTED]
Subject: Re: Numbers


> Can anyone help me with this hair pulling exercise.
>
> I've been working on a Bonus Penalty/Levy calculator where most
computations
> involve rounding - not a problem.
>
> In one spot the calculation needs to be truncated, not rounded, to 3
decimal
> places - how do I do this? Please help!
>
> Example:
>
> 9.9976 would become 9.998 when #NumberFormat(Variable, "9.999")# is
applied
> but I need it to be 9.997
>
>
> +++++++++
> Kevin Parker
> Service and Communication
> WorkCover Corporation


This will work...

<cfset MyNum = 9.9976>
<cfoutput>#left(MyNum, (Find(".",MyNum)+3))#</cfoutput>

HTH,
Steve

----------------------------------------------------------------------------
--
Archives: http://www.eGroups.com/list/cf-talk
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.



****************************************************************************
This e-mail is intended for the use of the addressee only. It may contain
information that is protected by legislated confidentiality and/or is
legally privileged. If you are not the intended recipient you are prohibited
from disseminating, distributing or copying this e-mail. Any opinion
expressed in this e-mail may not necessarily be that of the WorkCover
Corporation of South Australia. Although precautions have been taken, the
sender cannot warrant that this e-mail or any files transmitted with it are
free of viruses or any other defect.
If you have received this e-mail in error, please notify the sender
immediately by return e-mail and destroy the original e-mail and any copies.
****************************************************************************
------------------------------------------------------------------------------
Archives: http://www.eGroups.com/list/cf-talk
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.

Reply via email to