Skip to content

Money

Inherits: LibTSMModule

Functions

FromString

lua
function UI.Money.FromString(value)
  -> 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:

NameTypeDescription
valuestringThe money value to be converted as a string

Returns:

TypeDescription
number?

ToStringExact

lua
function UI.Money.ToStringExact(value, color)
  -> string

Converts a money value to a string with maximum precision.

Parameters:

NameTypeDescription
valuenumberThe value in copper
colorstringAn optional color value

Returns:

TypeDescription
string

ToStringForAH

lua
function UI.Money.ToStringForAH(value, color, disabled)
  -> string

Converts a money value to a string with settings suitable for the auction house.

Parameters:

NameTypeDescription
valuenumberThe value in copper
colorstringAn optional color value
disabledbooleanOptionally use the disabled tokens

Returns:

TypeDescription
string

ToStringForTooltip

lua
function UI.Money.ToStringForTooltip(value, color, useIcon, disabled)
  -> string

Converts a money value to a string with maximum precision.

Parameters:

NameTypeDescription
valuenumberThe value in copper
colorstringThe color value
useIconbooleanUse icons instead of text
disabledbooleanUse the disabled format

Returns:

TypeDescription
string

ToStringForUI

lua
function UI.Money.ToStringForUI(value, color)
  -> string

Converts a money value to a string with settings suitable for the UI.

Parameters:

NameTypeDescription
valuenumberThe value in copper
colorstringAn optional color value

Returns:

TypeDescription
string

ToStringForUIShort

lua
function UI.Money.ToStringForUIShort(value)
  -> string

Converts a money value to as short of a string as possible for display in the UI.

Parameters:

NameTypeDescription
valuenumberThe value in copper

Returns:

TypeDescription
string