website logo
Navigate through spaces
ChartHop documentation
⌘K
ChartHop Help Center
Getting around in ChartHop
ChartHop for Employees
Implementing ChartHop
ChartHop for Administrators
Carrot reference
ChartHop for Developers
Partners
Release notes
Resources
Docs powered by archbee 
website logo

formatMoney()

Converts a given value of type Money into a String, while retaining the currency type in the String output. Optionally specify the format and locale of the returned value.

Syntax

formatMoney(money[, format][, locale])

  • money - the Money value to be converted to a String
  • format - a formatting string that uses Java's DecimalFormat to format the number. For example, #.00 will format the returned value to two decimal places. Learn how to use DecimalFormat here, and view additional examples of DecimalFormat here.
  • locale - an ISO 639-1 language code, optionally followed by an ISO 3166-1 country code, used to apply proper localization settings to the returned value. For example, en-US will format the returned value using US English settings, whereas en-GB will format using British English and fr-CA will format using French Canadian settings. If locale is not passed, it will use the org's default locale (typically en-US).
  • Return type: String

Sample usage

formatMoney(base) returns the value of base as a String, including the currency symbol.

Supported data types

Input type

Return type

Logic

Money

String

If a Money value is passed, it's value will returned as a String, including the currency symbol.

Unsupported data types

Null

Unsupported data types return Null.



Updated 03 May 2023
Did this page help you?
Yes
No
PREVIOUS
monthEnd()
NEXT
formatRound()
Docs powered by archbee 
TABLE OF CONTENTS
Syntax
Sample usage
Supported data types