You are not logged in.
Pages: 1
Topic closed
Is it possible to round a decimal value to the number of digits you would like to have or display?
So instead of reading "25.12345" making a calculation to display one decimal place "25.1" or 3 decimal places "25.123" etc.
The ROUND function does not provide any decimal position, so you would get just "25" and that is not what I would like to have.
Thanks in advance,
Peter
Offline
Hello Peter,
please, can you specify where exactly do you want to round the numbers? Is it just for displaying during online monitoring or display in HMI? Or would you like to "trim" some of the signals directly in Rex and continue to process the rounded values?
Best Regards, Tomas
Offline
Hi Tomas,
Factually I would like to display it on HMI with just 1 or 2 decimal positions. I prefer to work with accurate numbers in the algorithm, but for the display it would be nice to trim it.
Offline
Hi Peter,
I presume that you are using RexHMI Designer based on Inkscape, am I right?
If so, select the display in RexHMI Designer and press Ctrl+E (or Extensions --> RexHMI --> Edit Element).
Switch to "Options" tab and there is parameter "decimals".
I hope the above is useful to you. Feel free to contact us if you have any other questions.
Cheers, Tomas
Offline
Hi Tomas?
Honestly said I did not used the Inkscape yet? But the simple WebUibi? Interface. And there is to my opinion no possibility to trim this formatting. Therefore I hope it can be done in the algorithm.
If not, I have to start learning and using RexHMI.
Offline
Peter, sorry for my assumption about the HMI you are using.
In case of WebBuDi you can also use parameter "decimals":
{type:"AW", ... , "decimals":2}
Regards, Tomas
Offline
Thanks a lot Tomas!
Offline
You are welcome, Peter. Good luck with your project!
Tomas
Offline
Pages: 1
Topic closed