API BreakUpLargeNumbers

From Wowpedia
Jump to: navigation, search

Converts a number into a localized string, grouping digits as required. (e.g. "1,234"). Starting with Mists of Panderia (5.0.4) all numbers in the user interface are displayed as localized strings.

valueString = BreakUpLargeNumbers(value);


Integer - The number to convert to a localized string (only the whole portion will be converted)


String - The number converted to a string


BreakUpLargeNumbers(    123);        returns "123"
BreakUpLargeNumbers(    123.45);     returns "123.45"
BreakUpLargeNumbers(    123.459);    returns "123.45"       (truncating at 2 decimal places)
BreakUpLargeNumbers(   1234);        returns "1,234"
BreakUpLargeNumbers(   1234.9);      returns "1,234"        (decimals are truncated if digit grouping is needed)
BreakUpLargeNumbers(1234567.89);     returns "1,234,567"
BreakUpLargeNumbers(1234567890.12);  returns "1234,567,890" (no more than 2 grouping separators are added)

Known bugs

BreakUpLargeNumbers does not add more than 2 digit groupings (i.e. at most it breaks up numbers into three groups)

Patch changes

See also