Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

Add a + when rawvalue >0

Avatar

Avatar
Level 1
joenelson1279
Level 1

Likes

0 likes

Total Posts

4 posts

Correct Reply

0 solutions
View profile

Avatar
Level 1
joenelson1279
Level 1

Likes

0 likes

Total Posts

4 posts

Correct Reply

0 solutions
View profile
joenelson1279
Level 1

21-03-2015

Hi, can someone tell me if its possible to have a + (plus sign) added when the number value is calculated as 0 or higher? And how would it need to be entered? Thanks!

Accepted Solutions (0)

Answers (4)

Answers (4)

Avatar

Avatar
Boost 50
MVP
_Bruce_Robertson
MVP

Likes

270 likes

Total Posts

1,782 posts

Correct Reply

372 solutions
Top badges earned
Boost 50
Boost 5
Boost 3
Boost 250
Boost 25
View profile

Avatar
Boost 50
MVP
_Bruce_Robertson
MVP

Likes

270 likes

Total Posts

1,782 posts

Correct Reply

372 solutions
Top badges earned
Boost 50
Boost 5
Boost 3
Boost 250
Boost 25
View profile
_Bruce_Robertson
MVP

22-03-2015

Hi,

Using mouslander's sample you would write

util.printf("%,0d", Field1.rawValue)

This would be added to the calculate event and set the language to JavaScript.

The difference with my approach is that negative numbers have a sign as well.

Regards

Bruce

Avatar

Avatar
Validate 1
Level 4
mouslander
Level 4

Likes

23 likes

Total Posts

298 posts

Correct Reply

27 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 10
Boost 1
View profile

Avatar
Validate 1
Level 4
mouslander
Level 4

Likes

23 likes

Total Posts

298 posts

Correct Reply

27 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 10
Boost 1
View profile
mouslander
Level 4

22-03-2015

If I understand your question properly you want a + if the number is greater than 0. If that is correct you would need to write a script that says something like:

if(Field1.rawValue > Number(0)) {

this.rawValue = Field1.rawValue + "+"

}

You will need to make your field a text field as it will not accept the + sign. If your field you are getting the information from in my sample Field1 is not numeric then you need to use the Number(0) otherwise it will be treated as a non-numerical character.

Avatar

Avatar
Level 1
joenelson1279
Level 1

Likes

0 likes

Total Posts

4 posts

Correct Reply

0 solutions
View profile

Avatar
Level 1
joenelson1279
Level 1

Likes

0 likes

Total Posts

4 posts

Correct Reply

0 solutions
View profile
joenelson1279
Level 1

22-03-2015

Thanks for your reply Bruce, but you lost me, lol. I'm new to LC and creating tables within the program. Are you able to explain more? If it's too lengthy don't worry about it. It is not necessary for me to have this but it would nice to have in my form. Thanks again.

Avatar

Avatar
Boost 50
MVP
_Bruce_Robertson
MVP

Likes

270 likes

Total Posts

1,782 posts

Correct Reply

372 solutions
Top badges earned
Boost 50
Boost 5
Boost 3
Boost 250
Boost 25
View profile

Avatar
Boost 50
MVP
_Bruce_Robertson
MVP

Likes

270 likes

Total Posts

1,782 posts

Correct Reply

372 solutions
Top badges earned
Boost 50
Boost 5
Boost 3
Boost 250
Boost 25
View profile
_Bruce_Robertson
MVP

22-03-2015

Hi,

You might be able to use the util.printf fuction, so util.printf('%,0+d',5) will return the string "+5" , this function is defined here, http://help.adobe.com/livedocs/acrobat_sdk/10/Acrobat10_HTMLHelp/wwhelp/wwhimpl/js/html/wwhelp.htm?h... There are lots of options, if you are dealing with decimal points change the d to an f.

Regards

Bruce