Expand my Community achievements bar.

Guidelines for the Responsible Use of Generative AI in the Experience Cloud Community.
SOLVED

How to format negative currency values (remove () )?.

Avatar

Level 3

Hi, I have a field that ocasionally can contain negative raw values.

What happens is, when a negative raw value is fed to the field, the field looks like this:

($999.999,00)

And I'd like it to look like this:

-$999.999,0

Any ideas how to do this?, I couldn't find any option in the patterns section.

Thanks!.

1 Accepted Solution

Avatar

Correct answer by
Level 3

Alright, I fixed it removing the num.currency{} formatting, and I replaced it for num{$zzz,zzz,zzz,zzz,zzz,zz9.99}

It seems like the () enclosing the number produces negative signs to dissapear.

View solution in original post

6 Replies

Avatar

Level 2

Try placing S before the $ in the pattern:

num{S$z,zzz,zz9.99}

Cheers

Avatar

Level 8

If you use num{$zzz,zzz,zz9.99} as your display pattern you will get the negative sign after the dollar sign:

$-999 999,00

Commas, periods and spaces are put in depending on the locale you choose. The example above is French(Canada). I'm not sure what locale would use periods to separate thousands.

Kyle

Avatar

Level 3

I don't have a num{S$z,zzz,zz9.99} I have this: num.currency{}

Avatar

Level 2

Placing a capital S before the $ will result in a negative sign appearing before the $ symbol  as  desired.

Avatar

Level 3

Well, that doen't happen, I see ($999.999,00).

My local es Spanish Argentina.

Avatar

Correct answer by
Level 3

Alright, I fixed it removing the num.currency{} formatting, and I replaced it for num{$zzz,zzz,zzz,zzz,zzz,zz9.99}

It seems like the () enclosing the number produces negative signs to dissapear.