---
title: money()
slug: money
docTags: 
createdAt: 2021-09-14T17:47:55.000Z
---

Converts a given value to datatype `Money`, including currency conversion.&#x20;

### Syntax

`money(value[, currency])`

- `value` - the value to be evaluated by the function.
- `currency` - (optional) the currency type of the returned `Money` value.
- **Return type:** [Money](docId:_kS5D2xbfoR9d8WfRIVnY)&#x20;

### Sample usage

`money(10)` returns `$10` if `USD` is the primary currency.

### Supported data types

| **Input type**                              | **Return type**                         | **Logic**                                                                                                                                      |
| ------------------------------------------- | --------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- |
| ****[Number](docId\:ucI5tCTfVBhonEJ6ZQijg)  | [Money](docId:_kS5D2xbfoR9d8WfRIVnY)    | If a `Number` value is passed, the amount will be returned as a `Money` value with the specified currency type (default: `org.currency`).      |
| [Money](docId:_kS5D2xbfoR9d8WfRIVnY)        | [Money](docId:_kS5D2xbfoR9d8WfRIVnY)    | If a `Money` value is passed, the amount will be converted to the specified currency value if it is different from the original currency type. |
| *Unsupported data types*                    | **[Null](docId\:N9trVqonnBknqL9DrNBP6)  | Unsupported data types return `Null`.                                                                                                          |

