Rounding to multiple of

Rounding to multiple of - Nearest ones, tens, hundreds, etc. - Messages

#1 Posted: 4/28/2016 3:24:48 PM
Ruben Sidranski

Ruben Sidranski

17 likes in 463 posts.

Group: 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 Posted: 4/28/2016 3:38:05 PM
Davide Carpi

Davide Carpi

1415 likes in 2872 posts.

Group: 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 users liked this post
ElSid 4/28/2016 3:48:00 PM, frapuano 4/28/2016 5:24:00 PM
#3 Posted: 4/29/2016 12:43:01 AM
Ruben Sidranski

Ruben Sidranski

17 likes in 463 posts.

Group: User

New built-in function, Round? Notice the capital "R"
Thanks for the work around
#4 Posted: 4/29/2016 2:26:38 AM
Mike Kaganski

Mike Kaganski

184 likes in 434 posts.

Group: 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 users liked this post
Davide Carpi 4/29/2016 4:10:00 AM
#5 Posted: 4/29/2016 4:12:38 AM
Davide Carpi

Davide Carpi

1415 likes in 2872 posts.

Group: 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 Posted: 4/29/2016 8:33:18 AM
Ruben Sidranski

Ruben Sidranski

17 likes in 463 posts.

Group: 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 Posted: 4/29/2016 10:38:30 AM
Jean Giraud

Jean Giraud

983 likes in 6866 posts.

Group: 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 Posted: 4/29/2016 10:41:13 AM
Jean Giraud

Jean Giraud

983 likes in 6866 posts.

Group: User

...

Forum round.gif
  • New Posts New Posts
  • No New Posts No New Posts