Number Formatting
Number Formatting is represents Number on axis line.
This is section we will discuss about Number Format Axis with an example.

We need to set valueFormatRange property of Axis as "numberformatting" to work with numberformatting axis. By default axis scale type is "numeric". Once you set the valueFormatRange property as number formatting, Axis will consider y values of all the data points as Number. Next you might want to change the number formatting displaced on Axis. You need to set valueFormat property in Axis to format the number values at once.

A Chart with Number Format y-axis & numeric y-axis


You can create a custom numeric format string, which consists of one or more custom numeric specifiers, to define how to format numeric data.

valueFormat examples

valueFormat Result after formatting
1234567.89( #,###.##) 1,234,567.89
1234567.89(#,###.###) 1,234,567.89
1234567.89(#,###.##0) 1,234,567.890
1234567.89(#,###.#) 1,234,567.6
1234567.89(#,##,###.#) 12,34,567.6
1234567.89(#,###,.##) 1,234.57
1234567.89(#,###,.##K) 1,234.57K
1234567.89(#,###,,.##M) 1.23M
1234567.89(#,##0,,,.#####LT) 0.00123LT
1234567.89(#.00E+0) 1.23E+6
1234567.89(##.00E+0) 12.35E+6
1234567.89(##.000E+00) 12.346E+09

Understanding how to build format String to format a numeric value (valueFormat)

Format specifier Name Description Examples
"0" Zero placeholder
Replaces the zero with the corresponding digit if one is present; otherwise, zero appears in the result string. The "0" custom format specifier serves as a zero-placeholder symbol. If the value that is being formatted has a digit in the position where the zero appears in the format string, that digit is copied to the result string; otherwise, a zero appears in the result string. The position of the leftmost zero before the decimal point and the rightmost zero after the decimal point determines the range of digits that are always present in the result string.

The "00" specifier causes the value to be rounded to the nearest digit preceding the decimal, where rounding away from zero is always used. For example, formatting 34.5 with "00" would result in the value 35.

1234.5678 ("00000") -> 01235
0.45678 ("0.00") -> 0.46
"#" Digit placeholder

Replaces the "#" symbol with the corresponding digit if one is present; otherwise, no digit appears in the result string. Note that no digit appears in the result string if the corresponding digit in the input string is a non-significant 0. For example, 0003 ("####") -> 3.

The "#" custom format specifier serves as a digit-placeholder symbol. If the value that is being formatted has a digit in the position where the "#" symbol appears in the format string, that digit is copied to the result string. Otherwise, nothing is stored in that position in the result string.

Note that this specifier never displays a zero that is not a significant digit, even if zero is the only digit in the string. It will display zero only if it is a significant digit in the number that is being displayed.

The "##" format string causes the value to be rounded to the nearest digit preceding the decimal, where rounding away from zero is always used. For example, formatting 34.5 with "##" would result in the value 35.

1234.5678 ("#####") -> 1235
0.45678 ("#.##") -> .46
"." Decimal point
Determines the location of the decimal separator in the result string. The "." custom format specifier inserts a localized decimal separator into the result string. The first period in the format string determines the location of the decimal separator in the formatted value; any additional periods are ignored.
0.45678 ("0.00") -> 0.46
0.45678 ("0.00", fr-FR) -> 0,46
"," Group separator and number scaling

Serves as both a group separator and a number scaling specifier. As a group separator, it inserts a localized group separator character between each group. As a number scaling specifier, it divides a number by 1000 for each comma specified.

The "," character serves as both a group separator and a number scaling specifier.

Group separator: If one or more commas are specified between two digit placeholders (0 or #) that format the integral digits of a number, a group separator character is inserted between each number group in the integral part of the output. For example, if the string "#,#" and the invariant culture are used to format the number 1000, the output is "1,000".

Number scaling specifier: If one or more commas are specified immediately to the left of the explicit or implicit decimal point, the number to be formatted is divided by 1000 for each comma. For example, if the string "0,," is used to format the number 100 million, the output is "100".

You can use group separator and number scaling specifiers in the same format string. For example, if the string "#,0,," and the invariant culture are used to format the number one billion, the output is "1,000".

Group separator specifier:
2147483647 ("##,#") -> 2,147,483,647

Scaling specifier:
2147483647 ("#,#,,") -> 2,147
"%" Percentage placeholder
Multiplies a number by 100 and inserts a localized percentage symbol in the result string. A percent sign (%) in a format string causes a number to be multiplied by 100 before it is formatted. The localized percent symbol is inserted in the number at the location where the % appears in the format string.
0.3697 ("%#0.00") -> %36.97
0.3697 ("##.0 %") -> 37.0 %
"‰" Per mille placeholder
Multiplies a number by 1000 and inserts a localized per mille symbol in the result string. A per mille character (‰ or \u2030) in a format string causes a number to be multiplied by 1000 before it is formatted. The appropriate per mille symbol is inserted in the returned string at the location where the ‰ symbol appears in the format string.
0.03697 ("#0.00‰") -> 36.97‰
"E0"
"E+0"
"E-0"
"e0"
"e+0"
"e-0"
Exponential notation

If followed by at least one 0 (zero), formats the result using exponential notation. The case of "E" or "e" indicates the case of the exponent symbol in the result string. The number of zeros following the "E" or "e" character determines the minimum number of digits in the exponent. A plus sign (+) indicates that a sign character always precedes the exponent. A minus sign (-) indicates that a sign character precedes only negative exponents.

If any of the strings "E", "E+", "E-", "e", "e+", or "e-" are present in the format string and are followed immediately by at least one zero, the number is formatted by using scientific notation with an "E" or "e" inserted between the number and the exponent. The number of zeros following the scientific notation indicator determines the minimum number of digits to output for the exponent. The "E+" and "e+" formats indicate that a plus sign or minus sign should always precede the exponent. The "E", "E-", "e", or "e-" formats indicate that a sign character should precede only negative exponents.

987654 ("#0.0e0") -> 98.8e4
1503.92311 ("0.0##e+00") -> 1.504e+03
1.8901385E-16 ("0.0e+00") -> 1.9e-16
"\" Escape character

Causes the next character to be interpreted as a literal rather than as a custom format specifier.

The "#", "0", ".", ",", "%", and "‰" symbols in a format string are interpreted as format specifiers rather than as literal characters. Depending on their position in a custom format string, the uppercase and lowercase "E" as well as the + and - symbols may also be interpreted as format specifiers.

To prevent a character from being interpreted as a format specifier, you can precede it with a backslash, which is the escape character. The escape character signifies that the following character is a character literal that should be included in the result string unchanged.

To include a backslash in a result string, you must escape it with another backslash ( \\ ).

987654 ("\###00\#") -> #987654#
'string'

"string"
Literal string delimiter
Indicates that the enclosed characters should be copied to the result string unchanged.
68 ("# 'degrees'") -> 68 degrees
68 ("#' degrees'") -> 68 degrees
; Section separator

Defines sections with separate format strings for positive, negative, and zero numbers.

The semicolon (;) is a conditional format specifier that applies different formatting to a number depending on whether its value is positive, negative, or zero. To produce this behavior, a custom format string can contain up to three sections separated by semicolons. These sections are described in the following table.

Number of sections Description
One section The format string applies to all values.
Two sections The first section applies to positive values and zeros, and the second section applies to negative values.

If the number to be formatted is negative, but becomes zero after rounding according to the format in the second section, the resulting zero is formatted according to the first section.
Three sections The first section applies to positive values, the second section applies to negative values, and the third section applies to zeros.

The second section can be left empty (by having nothing between the semicolons), in which case the first section applies to all nonzero values.

If the number to be formatted is nonzero, but becomes zero after rounding according to the format in the first or second section, the resulting zero is formatted according to the third section.
12.345 ("#0.0#;(#0.0#);-\0-") -> 12.35
0 ("#0.0#;(#0.0#);-\0-") -> -0-
-12.345 ("#0.0#;(#0.0#);-\0-") -> (12.35)
12.345 ("#0.0#;(#0.0#)") -> 12.35
0 ("#0.0#;(#0.0#)") -> 0.0
-12.345 ("#0.0#;(#0.0#)") -> (12.35)
Other All other characters

The character is copied to the result string unchanged.

Format specifiers that appear in a custom numeric format string are always interpreted as formatting characters and never as literal characters. This includes the following characters:
0 # % ‰ ' \ . ,
E or e, depending on its position in the format string.
All other characters are always interpreted as character literals and, in a formatting operation, are included in the result string unchanged. In a parsing operation, they must match the characters in the input string exactly; the comparison is case-sensitive.

68 ("# °") -> 68 °