Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Version published after converting to the new editor

Table of Contents
maxLevel1

...

Symbol LocationLocalized?Meaning
0NumberYes

Digit

There is support for K, M, B abbreviations in custom formatting: 0.0K / 0.0M / 0.0B where "0" drives the number of digits (# can be used too). 

Example for number "44,774.13":

  • Formatted as "0K" returns "45K"
  • Formatted as "0.0K" returns "44.8K"
  • Formatted as "0.00K" returns "44.77K"
 # NumberYes

Digit, zero shows as absent

Examples of use: 

  • # represents one digit but it is optional, ​so if you format 10.0001 as #'###.## you will end up with 10
  • If you want to force that a certain digit shows up, you use 0 instead of #
    • ​10.001 formatted with 0'000.00 would be displayed as 0'010.00 (just an example)
    • ​more typical pattern would be #'###.00 -> 10.00
      or
    • #'###.000 -> 10.001
  • If you format 1 with #'###.00 you will end up with 1.00
  • Also, most characters are not interpreted, so if the format string is "Value: #.## USD" and the number is 1.2, the formatting displays "Value: 1.2 USD"
NumberYesDecimal separator or monetary decimal separator
NumberYesMinus sign
NumberYesGrouping separator
NumberYesSeparates mantissa and exponent in scientific notation; need not be quoted in prefix or suffix
Subpattern boundaryYesSeparates positive and negative subpatterns  (see details below the table)
Prefix or Suffix YesMultiply by 100 and show as percentage
? (\u2030) Prefix or Suffix YesMultiply by 1000 and show as per million
¤ (\u00A4) Prefix or Suffix NoCurrency sign, replaced by currency symbol; if doubled, replaced by international currency symbol; if present in a pattern, the monetary decimal separator is used instead of the decimal separator
Prefix or Suffix NoUsed to quote special characters in a prefix or suffix; for example, "'#'#" formats 123 to "#123"; to create a single quote itself, use two in succession, such as "# o''clock"

If there is a semicolon in the pattern, then the first part (subpattern) is for positive values and the second is for negative ones, e.g. "#,##0.00;(#,##0.00)". Each subpattern has a prefix, a numeric part, and a suffix. If there is no explicit negative subpattern, the negative subpattern is the localized minus sign prefixed to the positive subpattern. That is, "0.00" alone is equivalent to "0.00;-0.00". If there is an explicit negative subpattern, it serves only to specify the negative prefix and suffix; the number of digits, minimal digits, and other characteristics are ignored in the negative subpattern. That means that "#,##0.0#;(#)" has precisely the same result as "#,##0.0#;(#,##0.0#)".

...