WoW API: GetCoinText

From AddOn Studio
Revision as of 04:45, 15 August 2023 by Move page script (talk | contribs) (Move page script moved page API GetCoinText to API GetCoinText without leaving a redirect)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

WoW API < GetCoinText

Breaks down an amount of money into gold/silver/copper, inserts separator strings, and returns the resulting string.

formattedAmount = GetCoinText(amount, "separator");

Parameters

Arguments

amount
Integer - the amount of money in copper (for example, the return value from GetMoney)
"separator"
String - a string to insert between the formatted amounts of currency, if there is more than one type

Returns

formattedAmount
String - a (presumably localized) string suitable for printing or displaying

Example

/script print(GetCoinText(12345," "))
1 Gold 23 Silver 45 Copper
/script print(GetCoinText(12345,"X"))
1 GoldX23 SilverX45 Copper