1 Pages (5 items)
Round Up Function - Functions to improve rounding options - Messages
#1 Posted: 5/23/2017 3:40:33 PM
Thanks for all the work you have put into this software!
I was wondering if you could make a function to round the value up. So round 2.2 up to 3. Or a function to round down or round to nearest 5... etc. Would be helpful when I am calculating the required number of items required and get 2.2 back, I need it to be 3 when I cannot have a partial item.
Thanks!
I was wondering if you could make a function to round the value up. So round 2.2 up to 3. Or a function to round down or round to nearest 5... etc. Would be helpful when I am calculating the required number of items required and get 2.2 back, I need it to be 3 when I cannot have a partial item.
Thanks!
#2 Posted: 5/23/2017 4:36:03 PM
WroteI was wondering if you could make a function to round the value up. So round 2.2 up to 3. Or a function to round down or round to nearest 5... etc. Would be helpful when I am calculating the required number of items required and get 2.2 back, I need it to be 3 when I cannot have a partial item.
Thanks!
How can maths invent that 2.2 could be/should be 5 ?
From the fx menu, scroll down to Ceil and plug your 2.2 in ... = 3
You could probably square the circle for 2.2 => 5
#3 Posted: 5/23/2017 6:10:52 PM
Hello Destory,
Apart from the Ceil function, you can write your own function for this, i have made an example for you:

you can edit the function (extra if loop) if you want it to handle negative numbers differently.
ceil_and_roundup_to_5.sm (7 KiB) downloaded 561 time(s).
I hope this helps you.
regards,
csb
Apart from the Ceil function, you can write your own function for this, i have made an example for you:

you can edit the function (extra if loop) if you want it to handle negative numbers differently.
ceil_and_roundup_to_5.sm (7 KiB) downloaded 561 time(s).
I hope this helps you.
regards,
csb
#5 Posted: 5/25/2017 10:43:25 PM
Here is the working program for n=5
A bit confusing for n ≠ 5
Jean
Utilities Matrix roundup_n.sm (10 KiB) downloaded 421 time(s).
A bit confusing for n ≠ 5
Jean
Utilities Matrix roundup_n.sm (10 KiB) downloaded 421 time(s).
1 Pages (5 items)
-
New Posts
-
No New Posts