- Desktop
- Scripting
- Formulas and Scripting Functions
- Rounding Function
Rounding Function
Overview
Section titled “Overview”The Round() function in scripting allows you to directly control the decimal places a script value outputs and works with. In the following example you can see two Show View indicators overlaid on top of each other.
Both are using an identical script, except one (yellow) has the Round() function applied, limiting the script values to 2 decimal places. You can see the effect it has with larger movements between each value, and smoother tops as the values are rounded up / down compared to the green plot.
The Round() function can be applied to any script that produces a numerical value.
Example
V1 = CLOSE() / OPEN() ;
ROUND(V1, DECIMALTYPE=0.00)
Your privacy choices
We use cookies and similar technologies to make the site work, see how it's used, and improve it. Analytics and advertising cookies only run with your consent — see our Privacy Policy for details.