The number I get after the process is 1.73466457756. How can I print this as 1.7? I want to round the number. which java code can i write
Just for clarity - we will use JavaScript for this rather than JAVA.
prez.variable("round",Math.round(prez.variable("myNum")*10)/10);
Where the variable named round is your newly rounded value and the variable named myNum is the original value to be rounded.
Hope this helps.
3 Likes
Hi,
I just wanted to let you guys know that in version 10.1, which was released a few days ago, there’s a variable reference formatting feature that allows you to round numbers as you like:
For more details on how to use this feature, please refer to the User Manual, page 287.
Best Regards,
