How to round up values

roundup
muparser

#1

Hi, everyone. Can someone please tell me how to round up values in formulas? I saw something about it somewhere and now I’ve been searching for the past goodness knows how long and can’t find it.

If someone can point me to a website with all the muparser things, I’d really appreciate it.

Thank you :slight_smile:


#2

I did’nt know this either but this how I found out.

In Valentina Drawing mode.

Right click on the point in question.

Click on the formula button ‘f(x)’

Click on the radio button ‘Functions’ Click on abs() a description for that function appears as help text.

You will find that rint() rounds to nearest integer rint(x + 0.5 ) should round up.


#3

http://beltoforion.de/article.php?a=muparser


#4

Thank you very much @bamba and @dismine :slight_smile:


#5

https://www.codeproject.com/Articles/18384/Parsing-Mathematical-Expressions-with-muParser#idDef1


#6

oops. I should have read all the way to the end of the thread before I replied. I see you already found the info :wink:


#7

Thank you, all the same :slight_smile:


#8

On second thoughts rint( (x) + 0.49 ) might be safer as rint( (1.0 ) + 0.5 ) would give 2.