Round Up Function

Round Up Function - Functions to improve rounding options - Сообщения

#1 Опубликовано: 23.05.2017 15:40:33
Daniel Story

Daniel Story

0 сообщений из 1 понравились пользователям.

Группа: User

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!
#2 Опубликовано: 23.05.2017 16:36:03
Jean Giraud

Jean Giraud

983 сообщений из 6866 понравились пользователям.

Группа: User

Wrote

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!



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 Опубликовано: 23.05.2017 18:10:52
csb531

csb531

0 сообщений из 24 понравились пользователям.

Группа: User

Hello Destory,

Apart from the Ceil function, you can write your own function for this, i have made an example for you:
example

you can edit the function (extra if loop) if you want it to handle negative numbers differently.
ceil_and_roundup_to_5.sm (7 КиБ) скачан 537 раз(а).

I hope this helps you.

regards,
csb
#4 Опубликовано: 23.05.2017 18:18:43
csb531

csb531

0 сообщений из 24 понравились пользователям.

Группа: User

The image:
roundupto5.JPG

#5 Опубликовано: 25.05.2017 22:43:25
Jean Giraud

Jean Giraud

983 сообщений из 6866 понравились пользователям.

Группа: User

Here is the working program for n=5
A bit confusing for n ≠ 5

Jean

Utilities Matrix roundup_n.sm (10 КиБ) скачан 400 раз(а).
  • Новые сообщения Новые сообщения
  • Нет новых сообщений Нет новых сообщений