website logo
ChartHop documentation
Carrot reference
Release notes
Navigate through spaces
ChartHop documentation
Carrot reference
Release notes
⌘K
Getting started
Getting started with Carrot
Operator precedence
Filtering with Carrot
Data categories
Basic Org Information
Compensation
Job Changes
Permissions
Personal
Recruiting
Structure
Time off
Data types
Address
Boolean
Comp
Comp Band
Currency
Date
DateTime
DaysOff
Enum
EnumList
File
Group
Image
Job
List
Money
Name
Number
Null
Percent
Person
PersonList
Shares
StockGrant
String
TimeOff
User
Operators
+ (add)
- (subtract)
* (multiply)
/ (divide)
% (modulus)
&& (and)
|| (or)
if
: (match)
= (equals)
!= (not-equals)
! (not)
> (greater-than)
>= (greater-than-equals)
< (less-than)
<= (less-than-equals)
[ ](array)
. (dot)
? (ternary)
?: (elvis)
Functions
abs()
asOf()
boolean()
compHistory()
compBetween()
costBetween()
date()
day()
daysOffBetween()
diffYears()
diffMonths()
distance()
monthEnd()
formatMoney()
formatRound()
formatNumber()
formatPercent()
formatDate()
grantedShares()
length()
max()
mean()
money()
month()
min()
nextAnniversary()
number()
pluralize()
percent()
random()
round()
roundUp()
roundDown()
string()
subString()
stockPrice()
monthStart()
split()
vestValue()
vestShares()
year()
Aggregators
count{}
max{}
mean{}
min{}
sum{}
Docs powered by archbee 
5min

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 07 Dec 2021
Did this page help you?
Yes
No
UP NEXT
formatRound()
Docs powered by archbee 
TABLE OF CONTENTS
Syntax
Sample usage
Supported data types