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

Avatar

Avatar
Validate 1
Level 1
endreddy
Level 1

Like

1 like

Total Posts

3 posts

Correct reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile

Avatar
Validate 1
Level 1
endreddy
Level 1

Like

1 like

Total Posts

3 posts

Correct reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile
endreddy
Level 1

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)

Avatar

Avatar
Establish
MVP
_Bruce_Robertson
MVP

Likes

271 likes

Total Posts

1,782 posts

Correct reply

372 solutions
Top badges earned
Establish
Give Back 25
Give Back 10
Give Back 5
Give Back 3
View profile

Avatar
Establish
MVP
_Bruce_Robertson
MVP

Likes

271 likes

Total Posts

1,782 posts

Correct reply

372 solutions
Top badges earned
Establish
Give Back 25
Give Back 10
Give Back 5
Give Back 3
View profile
_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)

Avatar

Avatar
Validate 1
Level 1
endreddy
Level 1

Like

1 like

Total Posts

3 posts

Correct reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile

Avatar
Validate 1
Level 1
endreddy
Level 1

Like

1 like

Total Posts

3 posts

Correct reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile
endreddy
Level 1

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 !!

Avatar

Avatar
Validate 1
Level 1
endreddy
Level 1

Like

1 like

Total Posts

3 posts

Correct reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile

Avatar
Validate 1
Level 1
endreddy
Level 1

Like

1 like

Total Posts

3 posts

Correct reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile
endreddy
Level 1

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 !!

Avatar

Avatar
Establish
MVP
_Bruce_Robertson
MVP

Likes

271 likes

Total Posts

1,782 posts

Correct reply

372 solutions
Top badges earned
Establish
Give Back 25
Give Back 10
Give Back 5
Give Back 3
View profile

Avatar
Establish
MVP
_Bruce_Robertson
MVP

Likes

271 likes

Total Posts

1,782 posts

Correct reply

372 solutions
Top badges earned
Establish
Give Back 25
Give Back 10
Give Back 5
Give Back 3
View profile
_Bruce_Robertson
MVP

25-02-2016

Hi,

Try using a display pattern of num{$z,zzz,zzz,zzz,zz9.99}

Regards

Bruce