
Re: Limit number of digits after the ","
Roger Palmen Jun 19, 2017 6:39 AM (in response to pablo77f)2 of 2 people found this helpfulWhat exactly does 'two digits' mean to you?
The number you say you need is a floating point number having a variable number of digits.How this number is displayed, is controlled by the visualization and/or the PI Points DisplayDigits setting.
If you round to two digits, then the value is rounded to two digits. But beware the syntax: the Round function uses to second argument as: "The size of the unit to round to"
So if i use Round(1.2345,0.01) the output is 1.23

Re: Limit number of digits after the ","
pablo77f Jun 19, 2017 1:22 PM (in response to Roger Palmen)
Re: Limit number of digits after the ","
rdavin Jun 19, 2017 2:59 PM (in response to pablo77f)1 of 1 people found this helpfulJust to clarify because Roger Palmen did provide a good answer. Both Roundfrac and Round will round a number. If only 1 argument is provided to Round, then its rounds to an integer. If 2 arguments are provided to Round, it will round to the specified precision.
Note that Roundfrac(number, 2) actually calls Round(number, 0.01). They are equivalent statements.
And you are not truncating to 2 digits. You are indeed rounding with no more than 2 digits. There is a difference.



Re: Limit number of digits after the ","
rdavin Jun 19, 2017 11:03 AM (in response to pablo77f)Hi Pablo,
There are 2 functions to round as well well as another function to truncate. The Trunc function is takes same inputs as Round, so usage is similar to what Roger Palmen posted. There is also a Roundfrac(number, digits) function.
Rounding down looks same as Trunc:
Rounding up is different from Trunc:

Re: Limit number of digits after the ","
pablo77f Jun 19, 2017 1:03 PM (in response to pablo77f)Hi,
Thank you for all answers.
I used the "Roundfrac" function and it's works excellent.
Thanks and regards.