rounding down function?

i have the following two variables that are both integers.

1. points
2. entries

#1, points has an initial value of 0.
#2, entries has an initial value of 1.

i want to make it so that for every 25 points, entries goes up by 1.

is there a cold fusion function that will round down.

meaning if they have 77 points, that would come out to (77/25) + 1 = 4.08 entries,
but i need it to come out as 4 entires. the + 1 is there because of the entries variable starts out at 1.

Judy DeoAsked:
Who is Participating?
 
SewellMCommented:
#int((77/25) + 1)# would return 4.

The int() function only returns the integer part of the value.  No rounding.

Michael
0
 
CFDevHeadCommented:
if you use #round(evaluate( (77/25) + 1))#
the answer will be 4

let me know if this helps.
0
 
CFDevHeadCommented:
int(4.5) will output 4
and
round(4.5) will output 5
0
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
Judy DeoAuthor Commented:
would the Fix function also work?
0
 
CFDevHeadCommented:
the fix function works like this
#fix(4.5)#=4
0
 
anandkpCommented:
u have 4 functions fix, cileing, int & round

go for int - if u always want integer value
go for fix - if u want least integer value
go for cieling - if u want the next integer value
go for round - if u plan to round of to nearest integer

ur call :)

Cheers
Anand
0
 
MauseCommented:
you can also do this:

<cfset result = (77 \ 25)>
result will be 3

And ofcourse

<cfset rest = (77 mod 25)>
rest will be  2

Mause
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.