Unified currency configuration used by all addons — banking, shops, hospital, and anywhere money amounts appear in TTS speech or voice input parsing.
Config file: shared/currency.lua
CurrencyConfig.symbol#| Type | Default |
|---|---|
string | "$" |
Currency symbol prepended or appended to formatted amounts. Common values: "$", "€", "£", "₹", "¥".
CurrencyConfig.name#| Type | Default |
|---|---|
string | "dollar" |
Singular currency name used in TTS speech. Example: "1 dollar".
CurrencyConfig.namePlural#| Type | Default |
|---|---|
string | "dollars" |
Plural currency name used in TTS speech. Example: "500 dollars".
CurrencyConfig.slang#| Type | Default |
|---|---|
string[] | {"bucks"} |
Informal names recognized in voice input. Players can say "give me 500 bucks" and the parser will strip the slang word before processing the amount. Add any informal terms your players use.
CurrencyConfig.slang = { "bucks", "cash", "bread" }
CurrencyConfig.position#| Type | Default | Values |
|---|---|---|
string | "before" | "before" | "after" |
Controls where the symbol or name appears in formatted output.
"before" — symbol before number: $1,500 / €1.500"after" — word after number: 1,500 dollars / 1.500 eurosWhen position = "after", FormatCurrency uses name/namePlural instead of symbol.
CurrencyConfig.separator#| Type | Default | Values |
|---|---|---|
string | "," | "," | "." | " " |
Thousands separator used when formatting numbers.
| Value | Example |
|---|---|
"," | 1,500 |
"." | 1.500 |
" " | 1 500 |
-- Default(USD) CurrencyConfig = { symbol = "$", name = "dollar", namePlural = "dollars", slang = { "bucks" }, position = "before", separator = ",", } -- Euro example CurrencyConfig = { symbol = "€", name = "euro", namePlural = "euros", slang = {}, position = "after", separator = ".", }
Three global functions are exposed for use in addon scripts. Do not modify them.
FormatCurrency(amount)#Formats an amount according to position. Returns symbol + number or number + word.
FormatCurrency(1500) -- → "$1,500" (before) or "1,500 dollars" (after) FormatCurrency(1) -- → "$1" (before) or "1 dollar" (after, singular)
FormatCurrencyWords(amount)#Always formats as number + word, regardless of position. Used for TTS speech where the symbol is not spoken.
FormatCurrencyWords(1500) -- → "1,500 dollars" FormatCurrencyWords(1) -- → "1 dollar"
StripCurrencyText(text)#Strips currency words, symbols, and slang from voice input before amount parsing. Called automatically by all addon parseAmount functions — you typically do not need to call this directly.
Strips: configured name, namePlural, all slang entries (including pluralized forms), common symbols ($, €, £, ¥, ₹, ₩, ₪, ฿), thousands separators, and surrounding whitespace.
StripCurrencyText("give me five hundred bucks") -- → "give me five hundred" StripCurrencyText("$1,500 dollars") -- → "1500"
Last updated about 9 hours ago