nut.currency.toString - brianhang/nutscript2 GitHub Wiki

Description

result = nut.currency.toString(amount)

This shared function converts the given numeric amount into a string representation. If nut.currency.symbol is set, then the resulting value is <symbol><amount>. Otherwise, the format is <amount> <unit> where <unit> is either nut.currency.singular or nut.currency.plural depending on which one is the correct one.

Parameters

Name Description
amount The amount of money.

Returns

Name Description
result The string representation of the given amount.

Example

print("I have "..nut.currency.toString(10).." in my wallet.")
⚠️ **GitHub.com Fallback** ⚠️