How to set the num.currency{} such a way that it will display "-" sign for Negative numbers instead of "()"

endreddy

25-02-2016

Hi Adobe folks,

I am working on a Adobe invoice form, where in few currency fields might need to show as "-" if it is negative number.

I am using Display pattern num.currency{}, but its displaying it as ($1,234,567.89), I want this to display as $-1,234,567.89

Can anyone please let me know how to achieve this.

2-25-2016 1-16-10 PM.jpg

2-25-2016 1-27-20 PM.jpg

Accepted Solutions (1)

Accepted Solutions (1)

_Bruce_Robertson

MVP

26-02-2016

Hi,

I did wonder if it would be that easy.  It does seem that US and Hong Kong are the only ones that use the brackets for negative numbers.  The Australian currency displays as you want.  Maybe you can go into the XML Source and change the line <numberPattern name="currency">$z,zz9.99|($z,zz9.99)</numberPattern> to <numberPattern name="currency">$z,zz9.99</numberPattern> .  Which is how the Australian one looks ... would need some testing though.

Or maybe you can have the decimal field hidden and display a text field with a calculation like DecimalField.formattedValue.replace(/[()]/g,"");. Do you need to line up the decimal points?

Bruce

Answers (3)

Answers (3)

endreddy

25-02-2016

I can use num{$z,zzz,zzz,zzz,zz9.99} to make it display -ve sign, but that defeats my main purpose, which is formatting the amount as per the Currency code. (For example if its USD it prints with 2 decimals like 22.33, and if its Japan currency, it prints without decimals 22)

That's the reason i wanted to use num.currency{} but want to print -ve numbers without braces.

Any help in achieving the "-"ve sign instead of "()" using num.currency{} would be highly appreciated !!

endreddy

25-02-2016

I can use num{$z,zzz,zzz,zzz,zz9.99} to make it display -ve sign, but that defeats my main purpose, which is formatting the amount as per the Currency code. (For example if its USD it prints with 2 decimals like 22.33, and if its Japan currency, it prints without decimals 22)

That's the reason i wanted to use num.currency{} but want to print -ve numbers without braces.

Any help in achieving the "-"ve sign instead of "()" using num.currency{} would be highly appreciated !!