AsPercent

AsPercent ( double value );

Description

Converts a number into a string expressing percentage:

  • Symbol "%" is added after the number;
  • Up to two digits after the decimal point are used (precision is 0.01%);
  • Thousand separators (comma) are used.

Input parameters

Parameter Default value Description
value - Defines number to be converted into a string.

Example

input length = 9;
AddLabel(yes, AsPercent((close - close[length]) / close[length]));

This script adds a chart label showing percent Rate of Change in Close price.