AsText ( String format);

Default values:

format: NumberFormat.TWO_DECIMAL_PLACES


Converts a number into string with specified properties. The properties are adjusted using the format parameter which can be expressed as a NumberFormat constant.

Input parameters

Parameter Default value Description
value - Defines number to be converted into a string.
format NumberFormat.TWO_DECIMAL_PLACES Defines text format with a NumberFormat constant.


input length = 9;
AddLabel(yes, AsText((close - close[length]) / close[length], NumberFormat.TWO_DECIMAL_PLACES));

This script adds a chart label showing Rate of Change in Close price rounded down to two digits after the decimal point.