You can use a UDF for this:
http://www.cflib.org/udf.c
#Int(RoundUpDown(64118.56,
-Dain
P.S. - Here's the UDF:
<cfscript>
/**
* Rounds a number up or down to the nearest specified multiple.
*
* @param input Number you want to round. (Required)
* @param multiple Multiple by which to round. Default is 5. (Optional)
* @param direction Direction to round. Options are Up or Down. Default is Up (Optional)
* @return Returns a numberic value
* @author Casey Broich (cab@pagex.com)
* @version 1, June 27, 2002
*/
function RoundUpDown(input){
var roundval = 5;
var direction = "Up";
var result = 0;
if(ArrayLen(arguments) GTE 2)
roundval = arguments[2];
if(ArrayLen(arguments) GTE 3)
direction = arguments[3];
if(roundval EQ 0)
roundval = 1;
if((input MOD roundval) NEQ 0){
if((direction IS 1) OR (direction IS "Up")){
result = input + (roundval - (input MOD roundval));
}else{
result = input - (input MOD roundval);
}
}else{
result = input;
}
return result;
}
</cfscript>
Main Topics
Browse All Topics





by: dillusion13Posted on 2005-05-19 at 10:54:13ID: 14038795
is it always going to be in the thousands? Also, wouldn't that technically round to 64000?