### rounding off?

Posted:

**Sat Feb 11, 2017 12:28 am**hello guys, how do you round off a number?

from 2 decimal points... 22.75 = rounds off to 23 ...

from 2 decimal points... 22.75 = rounds off to 23 ...

Community Support for NeoBook, NeoPaint and NeoAppBuilder

http://www.neosoftware.com/community/

http://www.neosoftware.com/community/viewtopic.php?f=1&t=21847

Page **1** of **1**

Posted: **Sat Feb 11, 2017 12:28 am**

hello guys, how do you round off a number?

from 2 decimal points... 22.75 = rounds off to 23 ...

from 2 decimal points... 22.75 = rounds off to 23 ...

Posted: **Sat Feb 11, 2017 1:02 am**

Math "Round (22.75)" "-1" "[result]"

[result]=23

Math "Trunc (22.75)" "-1" "[result]"

[result]=22

[result]=23

Math "Trunc (22.75)" "-1" "[result]"

[result]=22

Posted: **Sat Feb 11, 2017 2:13 am**

thanks

Posted: **Sat Feb 11, 2017 7:32 am**

Posted: **Sat Feb 11, 2017 9:21 pm**

i tried that Gaev..

but somehow, the total result.. sometimes go 101... supposed to be 100..

but when i use the round value before the calculations, total is 100..

not sure why, but maybe rounding before the calculations..

but nevertheless.. its just 1.. its fine..

but somehow, the total result.. sometimes go 101... supposed to be 100..

but when i use the round value before the calculations, total is 100..

not sure why, but maybe rounding before the calculations..

but nevertheless.. its just 1.. its fine..

Posted: **Sun Feb 12, 2017 6:21 am**

yanzco:

I tried the following tests that all produced results as expected ...

[yourNumber] ==> [roundedResult]

100.1 ==> 100

100.49 ==> 100

100.5 ==> 101

100.67 ==> 101

Please post the input values you used that resulted in incorrect answers.

Also, post the exact Math command you are using.

but somehow, the total result.. sometimes go 101... supposed to be 100..

I tried the following tests that all produced results as expected ...

[yourNumber] ==> [roundedResult]

100.1 ==> 100

100.49 ==> 100

100.5 ==> 101

100.67 ==> 101

Please post the input values you used that resulted in incorrect answers.

Also, post the exact Math command you are using.

Posted: **Sun Feb 12, 2017 9:03 am**

i see, it seems to work properly now, i think it was the math computation that i used before..

it was some percentage calculation, then some additions, then some more additions..

but all is fine now..

it was some percentage calculation, then some additions, then some more additions..

but all is fine now..