---
title: formatMoney()
slug: formatmoney
docTags: 
createdAt: 2021-09-14T17:46:23.000Z
---

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](https://docs.oracle.com/javase/7/docs/api/java/text/DecimalFormat.html), and view additional examples of `DecimalFormat` [here](http://tutorials.jenkov.com/java-internationalization/decimalformat.html).
- `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](docId\:Ujw2AQAktel5uukLuP73S)&#x20;

### 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](docId:_kS5D2xbfoR9d8WfRIVnY)  | [String](docId\:Ujw2AQAktel5uukLuP73S)  | If a Money value is passed, it's value will returned as a String, including the currency symbol. |
| *Unsupported data types*                  | **[Null](docId\:N9trVqonnBknqL9DrNBP6)  | Unsupported data types return `Null`.                                                            |

