Money
The Money module provides various APIs which wrap MoneyFormatter objects to format currency
values for different purposes within a UI.
API
-
class UI.Money:
LibTSMModule -
staticmethod ToStringForAH(value:
number, color?:string, disabled?:boolean):string Converts a money value to a string with settings suitable for the auction house.
- Parameters:
value (
number) – The value in coppercolor? (
string) – An optional color valuedisabled? (
boolean) – Optionally use the disabled tokens
-
staticmethod ToStringForUI(value:
number, color?:string):string Converts a money value to a string with settings suitable for the UI.
- Parameters:
value (
number) – The value in coppercolor? (
string) – An optional color value
-
staticmethod ToStringForUIShort(value:
number):string Converts a money value to as short of a string as possible for display in the UI.
- Parameters:
value (
number) – The value in copper
-
staticmethod ToStringExact(value:
number, color?:string):string Converts a money value to a string with maximum precision.
- Parameters:
value (
number) – The value in coppercolor? (
string) – An optional color value
-
staticmethod ToStringForTooltip(
value:number,
color?:string,
useIcon?:boolean,
disabled?:boolean
):string Converts a money value to a string with maximum precision.
- Parameters:
value (
number) – The value in coppercolor? (
string) – The color valueuseIcon? (
boolean) – Use icons instead of textdisabled? (
boolean) – Use the disabled format
-
staticmethod FromString(value:
string):number? Converts a string money value to a number value (in copper). The value passed to this function can contain colored text, but must use g/s/c for the denominations and not icons.
- Parameters:
value (
string) – The money value to be converted as a string
-
staticmethod ToStringForAH(value: