PDA

View Full Version : rounding up?



KyleC
April 13th, 2006, 03:12
Is it possible for a number control to round up?

-KyleC

Toadwart
April 21st, 2006, 11:27
Can you give us a bit more info as to what you are trying to do?
Numbercontrols only accept integer values. So there should be no need to round...unless you are doing a division operation, in which case I don't think you have any control over the rounding...

KyleC
April 25th, 2006, 19:59
Can you give us a bit more info as to what you are trying to do?
Numbercontrols only accept integer values. So there should be no need to round...unless you are doing a division operation, in which case I don't think you have any control over the rounding...

I think you just answered my question. I am performing a division operation and would have liked to be able to round the result up instead of down.

That's a bummer, but thanks for the help.

-KyleC

Ged
April 25th, 2006, 20:31
A way around in some specific cases is to make use of valuemaps. Say, you wanted to add together two numbers, divide by two and round up. You could add the figures together and define a valuemap (which is basically a look-up table) to perform the division so that the valuemap="0:0,1:1,2:1,3:2,4:2" etc.

KyleC
April 26th, 2006, 15:37
A way around in some specific cases is to make use of valuemaps. Say, you wanted to add together two numbers, divide by two and round up. You could add the figures together and define a valuemap (which is basically a look-up table) to perform the division so that the valuemap="0:0,1:1,2:1,3:2,4:2" etc.

That's what I eventually ended up doing.

-KyleC