ChartDirector 7.1 (C++ Edition)

BaseChart.formatValue


Usage

const char *formatValue(double value, const char *formatString);

Description

Formats a number/date using the ChartDirector formatting syntax as is in Parameter Substitution and Formatting.

Arguments

ArgumentDefaultDescription
value(Mandatory)The value to be formatted.
formatString(Mandatory)The format string, using {value} to denote the value. For example, ${value|2,} can be used to format the value to 2 decimal points, using "," as the thousand separator, and with a '$' sign in front.

Return Value

A text string containing the formatted result. The memory for the text string is allocated by the BaseChart object. The memory will be reused if this method is called again, and it will be freed when the BaseChart object is freed. So the text string is only valid until the next time this method is called or until the BaseChart object is freed. If you need to use the text string later, you would need to copy it to your own storage.