Re: Rounding to nearest 100

You have to multiply or divide it by multiples of ten then round it then

reverse the multiplication or division. Like so:

<!--- set initial value --->

<cfset myValue = 2587>

<!--- round to the nearest hundred --->

<cfset newValue = Round(myValue / 100) * 100>

<cfoutput>#newValue #</cfoutput>

Re: Rounding to nearest 100

Simon,

Thank you so much for you help! It works great! :)

Thanks again,

Carolyn

Re: Rounding to nearest 100

Hi again. If you don't mind I need a little more information.

For my initial question I asked about rounding to the nearest 100. I have now

created a new form to input support numbers. Most are coming in with totals

with two integers (ie, 35). For this section I assume I am going to set the

round to the nearest 10. However, what If I get a total in that exceeds the 2

digits and is in the 100s? I think I need a way to round to the nearest 10 OR

nearest 100 depending on the data. In this case do I need to set up if

statements?

Thanks in advance for any help!

Re: Rounding to nearest 100

Thank you that is very flatering.

For what you are trying to achieve you will need to use if statements. You'll

have to check the range of the current value amd the format the numbers

accordingly. If you need help with that then please post agina and we'll see

what we can do.