Skip to main content
Known Participant
July 15, 2008
Question

Need help with rounding up a number

  • July 15, 2008
  • 1 reply
  • 260 views
In my codes, there is a loop and when I cfdump the value, it looks like this:
2.0,.3.0,4.0, all the way to 32.0, etc
I need to use these number in a For Loop from="1" to="#ThisNumber#" but first I need to round it up so ThisNumber will come out as a whole number and not with the dot zero
Is there a function in CF that can do this? Please help!


This topic has been closed for replies.

1 reply

Inspiring
July 15, 2008
alecken wrote:
> In my codes, there is a loop and when I cfdump the value, it looks like this:
> 2.0,.3.0,4.0, all the way to 32.0, etc
> I need to use these number in a For Loop from="1" to="#ThisNumber#" but first
> I need to round it up so ThisNumber will come out as a whole number and not
> with the dot zero
> Is there a function in CF that can do this? Please help!
>

A quick glance at the documentation for mathmetical functions turns up
int(), floor() and ceiling() depending on how you would like to round
different types of numbers.