# Show negatives in brackets?

**URL:** <https://community.silverfin.com/t/show-negatives-in-brackets/1218>\
**Category:** Templates\
**Created:** [September 26, 2018, 2:30pm UTC](https://community.silverfin.com/t/show-negatives-in-brackets/1218 "2018-09-26T14:30:12Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![jhanley](https://avatars.discourse-cdn.com/v4/letter/j/43a26b/32.png) [@jhanley](https://community.silverfin.com/u/jhanley)\
**Post date:** [September 26, 2018, 2:30pm UTC](https://community.silverfin.com/t/show-negatives-in-brackets/1218/1 "2018-09-26T14:30:12Z")

</div>

Hi,

Is it possible to show negative figures in brackets? For example, the following code:

`{% assign example = (5-10) %} {{ example | integer }}`

Will provide the result: `-5`

Is there a way to show this as `(5)` instead?

Many thanks  
Joe

---

<div class="post-metadata">

**Author:** ![robindeclercq](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.silverfin.com/robindeclercq/32/472_2.png) [@robindeclercq](https://community.silverfin.com/u/robindeclercq)\
**Post date:** [September 26, 2018, 2:55pm UTC](https://community.silverfin.com/t/show-negatives-in-brackets/1218/2 "2018-09-26T14:55:05Z")

</div>

Hi @jhanley,

This can be done by using the ‘currency\_dc’-filter.

```
{% assign example = (5-10) %} {{ example | currency_dc:0 }}

```

This will provide the requested result (i.e. (5)).

Note that the `:0` is included in the code to limit the decimals. When you just use `currency_dc` the result will show 2 decimals.

Hope this was what you were looking for!

Kind regards,  
Robin

---

<div class="post-metadata">

**Author:** ![jhanley](https://avatars.discourse-cdn.com/v4/letter/j/43a26b/32.png) [@jhanley](https://community.silverfin.com/u/jhanley)\
**Post date:** [September 26, 2018, 3:02pm UTC](https://community.silverfin.com/t/show-negatives-in-brackets/1218/3 "2018-09-26T15:02:06Z")

</div>

Hi @robindeclercq,

Thanks for the quick response!

This looks to achieve what I’m after, though I’m not having much luck at producing the `(5)` result 😢

I copied the code you provided as a test, but this is still pulling through as `-5`?

Kind regards  
Joe

---

<div class="post-metadata">

**Author:** ![robindeclercq](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.silverfin.com/robindeclercq/32/472_2.png) [@robindeclercq](https://community.silverfin.com/u/robindeclercq)\
**Post date:** [September 26, 2018, 3:35pm UTC](https://community.silverfin.com/t/show-negatives-in-brackets/1218/4 "2018-09-26T15:35:30Z")

</div>

Hi @jhanley,

You’re totally right, my bad! I was a bit too quick with the response.

Next to the `currency_dc` filter you should also make sure that the settings in your environment are set to show negative amounts as `(X)` instead of `-X`.

To do so, the administrator in your environment should go to ‘Advanced’

![image](https://canada1.discourse-cdn.com/flex030/uploads/getsilverfin/original/1X/cd09a1c5d658e0132a65de3e1c9096a89d4b4a63.png)

Then to ‘Currency negative format’

![image](https://canada1.discourse-cdn.com/flex030/uploads/getsilverfin/original/1X/18e1a6180195ea41b51f5a6f8d44b026be51f30c.png)

And change `-xxx` to `(xxx)`

![image](https://canada1.discourse-cdn.com/flex030/uploads/getsilverfin/original/1X/9a7f21d9daf9605ba27c0aed11d7e0402729221e.png)

These settings in combination with `currency_dc` will make sure that negative numbers are always shown with brackets.

Kind regards,  
Robin

---

<div class="post-metadata">

**Author:** ![jhanley](https://avatars.discourse-cdn.com/v4/letter/j/43a26b/32.png) [@jhanley](https://community.silverfin.com/u/jhanley)\
**Post date:** [September 27, 2018, 8:06am UTC](https://community.silverfin.com/t/show-negatives-in-brackets/1218/5 "2018-09-27T08:06:03Z")

</div>

Thanks @robindeclercq, that makes perfect sense! I haven’t been able to test this yet as our admin user is not available, but I’m positive this will resolve my issue.

Thanks for all your help!  
Joe

---

<div class="post-metadata">

**Author:** ![sven](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.silverfin.com/sven/32/1495_2.png) [@sven](https://community.silverfin.com/u/sven)\
**Post date:** [October 1, 2018, 12:43pm UTC](https://community.silverfin.com/t/show-negatives-in-brackets/1218/6 "2018-10-01T12:43:06Z")

</div>

PS @jhanley,

this is explained here as well:

> [@CASE: currency formats in Silverfin](https://community.silverfin.com/t/case-currency-formats-in-silverfin/1202):
>
> In Silverfin there’s the possibility to express the currency formats in a different way: [46] [00] which will express any number visible in Silverfin this specific way ( this setting can only be activated by the Silverfin support through our chat or [support@silverfin.com](mailto:support@silverfin.com) ). In Liquid you can also express these numbers by using the currency\_dc filter: {{ #61 | currency\_dc }} {{ #70 | currency\_dc }} Output: [23]

The activation of those currency format is not something regular user can do by the way.

---

<div class="post-metadata">

**Author:** ![sven](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.silverfin.com/sven/32/1495_2.png) [@sven](https://community.silverfin.com/u/sven)\
**Post date:** [October 1, 2018, 12:43pm UTC](https://community.silverfin.com/t/show-negatives-in-brackets/1218/7 "2018-10-01T12:43:09Z")

</div>


