Rounding to multiple of

Rounding to multiple of - Nearest ones, tens, hundreds, etc. - Сообщения

#1 Опубликовано: 28.04.2016 15:24:48
Ruben Sidranski

Ruben Sidranski

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

Группа: User

I would like to have the answer "round" to the nearest XXX. In this example, I would like an answer that gives 520 and another that gives 500
I do not want to truncate to get the 500 as I may get 589 and would like to round up
Round.PNG
Apparently, units are part of the problem
#2 Опубликовано: 28.04.2016 15:38:05
Davide Carpi

Davide Carpi

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

Группа: Moderator

Something like this?

2016-04-28 20_53_17-SMath Studio Desktop - [mround.sm_].png
If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
2 пользователям понравился этот пост
ElSid 28.04.2016 15:48:00, frapuano 28.04.2016 17:24:00
#3 Опубликовано: 29.04.2016 00:43:01
Ruben Sidranski

Ruben Sidranski

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

Группа: User

New built-in function, Round? Notice the capital "R"
Thanks for the work around
#4 Опубликовано: 29.04.2016 02:26:38
Mike Kaganski

Mike Kaganski

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

Группа: User

Actually, I understand everyone who faces some problem, creates a function that helps him to solve it, and immidiately suggests to make it "built-in".
Yet, I want to note that it could be undesirable to clutter the main program with loads of utility functions. This way, growing weight is put on developer to support these functions.

It's better to include them to extensions (yet, this way the extension maintainer gets responsible for it).

But the best of it is the very ability of SMath to create custom functions like that Davide's one, that may be easily put into any sheet. If one prooves to be useful enough, Snippets is a very good place to put it.
С уважением, Михаил Каганский
1 пользователям понравился этот пост
Davide Carpi 29.04.2016 04:10:00
#5 Опубликовано: 29.04.2016 04:12:38
Davide Carpi

Davide Carpi

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

Группа: Moderator

Wrote

Notice the capital "R"


Seems to me a bad choice; when I provide functions made with this approach (case different on first character) the twin function can do the same things of the original when used with the same number of arguments (here is not possible). mround is not casual, it's the excel name for this function (round arg1 to the nearest multiple of arg2)
If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
#6 Опубликовано: 29.04.2016 08:33:18
Ruben Sidranski

Ruben Sidranski

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

Группа: User

I understand the "built in" function request conundrum. This is now in my user defined collapsed area. Doing HVAC, precision is not imperative and I round ... alot. In MathCAD, the function was Round, which is why I suggested capital R.

You guys are awesome!
#7 Опубликовано: 29.04.2016 10:38:30
Jean Giraud

Jean Giraud

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

Группа: User

Wrote

Actually, I understand everyone who faces some problem, creates a function that helps him to solve it, and immidiately suggests to make it "built-in".



===========================================

Can't be more right Mike !

Martin mentionned that some time ago. How much did I ask ? Almost nothing except for the
vectorising operator @ my begining of Smath. Conveniences like the square matrix bracket, ranging operators in the palette... So many plugins past version 5346 ??? More maths: yes in the sense of how to make Smath do more, like your Vicenty geographical distance.

Cheers Mike, Jean.


#8 Опубликовано: 29.04.2016 10:41:13
Jean Giraud

Jean Giraud

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

Группа: User

...

Forum round.gif
  • Новые сообщения Новые сообщения
  • Нет новых сообщений Нет новых сообщений