# Dynamic content - how does the "currency format" modifier work?

**URL:** https://integration.keap.com/t/dynamic-content-how-does-the-currency-format-modifier-work/91893
**Category:** Max Classic
**Tags:** dynamic-content
**Created:** [November 30, 2023, 3:45pm UTC](https://integration.keap.com/t/dynamic-content-how-does-the-currency-format-modifier-work/91893 "2023-11-30T15:45:41Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Andron\_Ocean](https://sea1.discourse-cdn.com/flex019/user_avatar/integration.keap.com/andron_ocean/32/2081_2.png) [@Andron\_Ocean](https://integration.keap.com/u/Andron_Ocean)
#### Post date: [November 30, 2023, 3:45pm UTC](https://integration.keap.com/t/dynamic-content-how-does-the-currency-format-modifier-work/91893/1 "2023-11-30T15:45:42Z")

</div>

I’m merging a price stored in a custom field (“currency” type) into an email. If I just insert the field directly, it comes out with a single decimal and no currency symbol, like `30.0`, which ain’t great.

However, when I select the field in the Dynamic Content builder tool, it offers “Currency Format” as one of the modifiers, with an empty parameters field next to it. I can’t find any documentation for what’s supposed to go in the parameters field. From testing, it seems to accept literally anything and always spits out the price formatted with a dollar sign and two cents places – i.e. all of the following give the same output despite their increasing ludicrousness:

```auto
[[contact.custom_fields.CJMSubscriptionPrice | currency]]
[[contact.custom_fields.CJMSubscriptionPrice | currency: true]]
[[contact.custom_fields.CJMSubscriptionPrice | currency: false]]
[[contact.custom_fields.CJMSubscriptionPrice | currency: 42]]
[[contact.custom_fields.CJMSubscriptionPrice | currency: abcdefghi]]
[[contact.custom_fields.CJMSubscriptionPrice | currency: "Zaphod Beeblebrox"]]

```

Are there any parameter values that actually do something? I’d love a way to format with/without cents for whole-dollar amounts, for instance. (I would assume it should work something like how date fields take the `custom: "YYYY"` Liquid filter for formatting.)

For now I’m just using the filter without a parameter since it seems safe enough.

---

<div class="post-metadata">

### Author: ![Pav](https://sea1.discourse-cdn.com/flex019/user_avatar/integration.keap.com/pav/32/124_2.png) [@Pav](https://integration.keap.com/u/Pav)
#### Post date: [December 1, 2023, 3:11pm UTC](https://integration.keap.com/t/dynamic-content-how-does-the-currency-format-modifier-work/91893/2 "2023-12-01T15:11:45Z")

</div>

Hi @Andron_Ocean,

I am not an expert on the syntax, but maybe this article will help below.

[https://docspring.com/docs/html\_templates/liquid\_filters.html](https://docspring.com/docs/html_templates/liquid_filters.html)

See if any of those parameters works.

```auto
currency
{{ number | currency }}

{{ number | currency: "<delimiter>", "<separator>", "<format>", "<negative_format>", "<precision>" }}
Formats a number as a currency, with grouped thousands and two decimal places (e.g. $12,324.00.)

Parameters:

unit - Sets the denomination of the currency (defaults to “$”).
delimiter - Sets the thousands delimiter (defaults to “,”).
separator - Sets the separator between the fractional and integer digits (defaults to “.”).
format - Sets the format for non-negative numbers (defaults to “%u%n”). Fields are %u for the currency, and %n for the number.
negative_format - Sets the format for negative numbers (defaults to prepending a hyphen to the formatted number given by format). Accepts the same fields than format, except %n is here the absolute value of the number.
precision - Sets the level of precision for decimal places (defaults to 2).
Examples:

{{ 1 | currency }}
=> "$1.00"

{{ 1000 | currency }}
=> "$1,000.00"

{{ 1234.56 | currency: "€", ".", "," }}
=> "€1.234,56"

{{ -1234567890.50 | currency: "$", ",", ".", "%u%n", "(%u%n)" }}
=> ($1,234,567,890.50)

{{ 1234567890.50 | currency: "R$", "", ",", "%n %u" }}
=> 1234567890,50 R$

```
