BreakUpLargeNumbers

From Warcraft Wiki
Jump to navigation Jump to search
Flavors
Links
Patch
Added in 6.0.2 / 1.13.2

Divides digits into groups using a localized delimiter character.

valueString = BreakUpLargeNumbers(value)

Arguments

value
number - The number to convert into a localized string

Returns

valueString
string - The whole-number portion converted into a string if greater than 1000, or truncated to two decimals if less than 1000.

Details

  • Large numbers are grouped into thousands and millions with a LARGE_NUMBER_SEPERATOR, but no further grouping happens for even larger numbers (billions).
  • Small numbers with a decimal portion are separated with a DECIMAL_SEPERATOR and truncated to two decimal places.
  • Not intended for use with negative numbers.

Example

BreakUpLargeNumbers(123.456789)   -- 123.45
BreakUpLargeNumbers(1234567.89)   -- 1,234,567
BreakUpLargeNumbers(1234567890)   -- 1234,567,890

Patch changes

See also

References

 
  1. ^ 2014-10-14, UIParent.lua, version 6.0.2.19033, near line 4131, archived at Townlong-Yak
  2. ^ 2012-08-21, UIParent.lua, version 5.0.4.16016, near line 4017, archived at Townlong-Yak