Rounding Numbers
Posted: Tue Oct 12, 2004 5:35 am
Well I guess my question is kind of rounding.
What I want to do is, say I had any number between 0 and 1, I would want that number to be rounded up to 1, even if it was 0.1 which would technically be closer to 0.
I have tried the basic round() function but wouldn’t get it to do what I want, as it was rounding to the closest number (rounding 0.1 to 0 instead of 1 as I want).
I think what I am looking for is some kind of 'if it is more than 0 round it to 1 and if it is more than 1 round it to 2' and so on.
I would really appreciate it if anyone could help, the answer is probably much easier than I think.
What I want to do is, say I had any number between 0 and 1, I would want that number to be rounded up to 1, even if it was 0.1 which would technically be closer to 0.
I have tried the basic round() function but wouldn’t get it to do what I want, as it was rounding to the closest number (rounding 0.1 to 0 instead of 1 as I want).
I think what I am looking for is some kind of 'if it is more than 0 round it to 1 and if it is more than 1 round it to 2' and so on.
I would really appreciate it if anyone could help, the answer is probably much easier than I think.