Appearance
MoneyFormatter
Inherits: Class
Methods
SetColor
lua
function MoneyFormatter:SetColor(colorPrefix)
-> selfSets a color prefix to use for the text components.
Parameters:
| Name | Type | Description |
|---|---|---|
colorPrefix | string | The color prefix string or nil to remove coloring |
Returns:
| Type | Description |
|---|---|
self |
SetCopperHandling
lua
function MoneyFormatter:SetCopperHandling(handling)
-> selfChanges how copper is handled.
Parameters:
| Name | Type | Description |
|---|---|---|
handling | EnumValue | How to handle copper |
Returns:
| Type | Description |
|---|---|
self |
SetFormat
lua
function MoneyFormatter:SetFormat(format)
-> selfSets the format.
Parameters:
| Name | Type | Description |
|---|---|---|
format | EnumValue | The format to use |
Returns:
| Type | Description |
|---|---|
self |
SetTrimEnabled
lua
function MoneyFormatter:SetTrimEnabled(enabled)
-> selfSets whether or not trailing 0 values should be trimmed.
Parameters:
| Name | Type | Description |
|---|---|---|
enabled | boolean | Whether or not trimming should be enabled |
Returns:
| Type | Description |
|---|---|
self |
ToString
lua
function MoneyFormatter:ToString(value)
-> stringConverts a money value to a string.
Parameters:
| Name | Type | Description |
|---|---|---|
value | number | The value in copper |
Returns:
| Type | Description |
|---|---|
string |
Functions
FromString
lua
function MoneyFormatter.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 text and not icon tokens.
Parameters:
| Name | Type | Description |
|---|---|---|
value | string | The money value to be converted |
Returns:
| Type | Description |
|---|---|
number? |
GetCopperText
lua
function MoneyFormatter.GetCopperText()
-> stringReturns the colored copper indicator text.
Returns:
| Type | Description |
|---|---|
string |
GetGoldText
lua
function MoneyFormatter.GetGoldText()
-> stringReturns the colored gold indicator text.
Returns:
| Type | Description |
|---|---|
string |
GetLargeNumberSeparator
lua
function MoneyFormatter.GetLargeNumberSeparator()
-> stringGets the large number separator.
Returns:
| Type | Description |
|---|---|
string |
GetSilverText
lua
function MoneyFormatter.GetSilverText()
-> stringReturns the colored silver indicator text.
Returns:
| Type | Description |
|---|---|
string |
New
lua
function MoneyFormatter.New()
-> MoneyFormatterCreates a new money formatter.
Returns:
| Type | Description |
|---|---|
MoneyFormatter |
SetLargeNumberSeparator
lua
function MoneyFormatter.SetLargeNumberSeparator(value)Sets the large number separator.
Parameters:
| Name | Type | Description |
|---|---|---|
value | string | The string value |