longman
06-16-2009, 06:37 AM
Hi All,
Is there a simple way of doing the following? I am working with percentages by using a basic operator ((number / 365)*100). If the resultant value is below 50% (regardless of how many decimal places there are), the number needs to round down to the nearest whole percent. If the value is above 50%, it should be rounded up to the nearst whole percent.
I have not been able to find a way. Ultimately, I am looking at including this within a function that does the above opertion to convert it to percentage so I can apply other rules to the result, and not having it as a separate function unless there is no other way. I am using IE6.
Any help would be appreciated. I have looked into the round method but couldn't find how to tell it do do what I want.
Cheers,
A
Is there a simple way of doing the following? I am working with percentages by using a basic operator ((number / 365)*100). If the resultant value is below 50% (regardless of how many decimal places there are), the number needs to round down to the nearest whole percent. If the value is above 50%, it should be rounded up to the nearst whole percent.
I have not been able to find a way. Ultimately, I am looking at including this within a function that does the above opertion to convert it to percentage so I can apply other rules to the result, and not having it as a separate function unless there is no other way. I am using IE6.
Any help would be appreciated. I have looked into the round method but couldn't find how to tell it do do what I want.
Cheers,
A