Add a + when rawvalue >0

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

Mark Solution

Are these answers useful?
Help other community members by marking useful answers as accepted.

Accepted Solutions (0)

Answers (4)

Answers (4)

BR001
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

mouslander 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.

joenelson1279 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.

BR001
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