format - Pine Script Constants
format
Section titled “format”Overview
Section titled “Overview”Constants under the format namespace.
Constants
Section titled “Constants”| Name | Type | Description |
|---|---|---|
format.inherit | const string | Is a named constant for selecting the formatting of the script output values from the parent series in the indicator function. |
format.mintick | const string | Is a named constant to use with the str.tostring function. Passing a number to str.tostring with this argument rounds the number to the nearest value that can be divided by syminfo.mintick, without the remainder, with ties rounding up, and returns the string version of said value with trailing zeros. |
format.percent | const string | Is a named constant for selecting the formatting of the script output values as a percentage in the indicator function. It adds a percent sign after values. |
format.price | const string | Is a named constant for selecting the formatting of the script output values as prices in the indicator function. |
format.volume | const string | Is a named constant for selecting the formatting of the script output values as volume in the indicator function, e.g. ‘5183’ will be formatted as ‘5.183K’. |
Remarks
Section titled “Remarks”format.percent: The default precision is 2, regardless of the precision of the chart itself. This can be changed with the ‘precision’ argument of the indicator function.format.price: If format is format.price, default precision value is set. You can use the precision argument of indicator function to change the precision value.