How Can i Add Naira Currency Symbol in my Adobe Form

Explorer ,
Mar 05, 2020

Copy link to clipboard

Copied

Hello all, please I need someone to assist me in looking at the following currency script for Naira, I have searched and tried several approaches but don’t know why am not getting the right result in my form, the following is the script I picked from Thom_Parker's post on the same topic, from the following link: https://acrobatusers.com/tutorials/formatting_text_fields/but it still did not work on my form.

 

event.value = String.fromCharCode(0x0A3) + event.value;

 

which by the above script description the following should give me the Naira currency symbol i need:

 

event.value = String.fromCharCode(0x20A6) + event.value; 

 

but instead, i get a bullet circle symbol on the field. i have used three different font type: "Open Sans", "Helvetica", and "Arial" but none of them gave me the sign, i have equally worked another clean page with a singular form field, yet i got the same result.

 

The following picture is how my currency symbol should look like this:

Naira.JPG

Please i will appreciate any support in this direction. Thanks!

Most Valuable Participant
Correct answer by try67 | Most Valuable Participant

Use this code:

 

if (event.value) event.value = "\u20A6" + util.printf("%,0.2f", event.value);

TOPICS
Acrobat SDK and JavaScript, Comment review and collaborate PDF, General troubleshooting, How to, PDF forms, Print and prepress, Standards and accessibility

Views

731

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

How Can i Add Naira Currency Symbol in my Adobe Form

Explorer ,
Mar 05, 2020

Copy link to clipboard

Copied

Hello all, please I need someone to assist me in looking at the following currency script for Naira, I have searched and tried several approaches but don’t know why am not getting the right result in my form, the following is the script I picked from Thom_Parker's post on the same topic, from the following link: https://acrobatusers.com/tutorials/formatting_text_fields/but it still did not work on my form.

 

event.value = String.fromCharCode(0x0A3) + event.value;

 

which by the above script description the following should give me the Naira currency symbol i need:

 

event.value = String.fromCharCode(0x20A6) + event.value; 

 

but instead, i get a bullet circle symbol on the field. i have used three different font type: "Open Sans", "Helvetica", and "Arial" but none of them gave me the sign, i have equally worked another clean page with a singular form field, yet i got the same result.

 

The following picture is how my currency symbol should look like this:

Naira.JPG

Please i will appreciate any support in this direction. Thanks!

Most Valuable Participant
Correct answer by try67 | Most Valuable Participant

Use this code:

 

if (event.value) event.value = "\u20A6" + util.printf("%,0.2f", event.value);

TOPICS
Acrobat SDK and JavaScript, Comment review and collaborate PDF, General troubleshooting, How to, PDF forms, Print and prepress, Standards and accessibility

Views

732

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Mar 05, 2020 0
Most Valuable Participant ,
Mar 05, 2020

Copy link to clipboard

Copied

Use the Unicode value, like this:

 

event.value = "\u20A6" + event.value;

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Mar 05, 2020 0
Explorer ,
Mar 05, 2020

Copy link to clipboard

Copied

Thank you so much try67, am very grateful for your response, but i have entered this script and it is still not giving me the symbol, instead i get a bullet circle sign like the picture below: 

 

Naira on Total.JPG

 

this is exactly how i entered the script in the custom format page below:

 

Script.JPG

custom currency script.JPG

please is there anything I am not doing right here?

 

i have equally used this:

event.value = String.fromCharCode(0x20A6) + event.value;

but still it didn't work.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Mar 05, 2020 0
Adobe Community Professional ,
Mar 06, 2020

Copy link to clipboard

Copied

For the field use a font like Arial.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Mar 06, 2020 0
Most Valuable Participant ,
Mar 06, 2020

Copy link to clipboard

Copied

Then the font you're using doesn't support unicode properly. I tried it with Helvetica and it worked fine:

 

Snap2.png

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Mar 06, 2020 0
Explorer ,
Mar 06, 2020

Copy link to clipboard

Copied

Thank you so much Bernd_Alheit and try67, i so much appreciate all the responses, but could there be something i am mixing up here, because its still not working, i have just tried the same thing on a clean page, it still turned out the same bullet sign, here is my attachment of entire property page of what i did and the main adobe page itself:

 

1 full_page.JPG2 General_Tab.JPG3 Appearance_Tab.JPG4 Options_Tab.JPG5 Action_Tab.JPG6 Format_Tab.JPG7 Validate_Tab.JPG8 Calculate_Tab.JPG

 

please i still need your assistance on getting this done, thank you so much for your kind responses. 

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Mar 06, 2020 0
Explorer ,
Mar 06, 2020

Copy link to clipboard

Copied

Hi, Bernd_Alheit, i have equally tried Arial, it still didn't work.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Mar 06, 2020 0
Adobe Community Professional ,
Mar 06, 2020

Copy link to clipboard

Copied

It works with font Arial:

Bild1.jpg

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Mar 06, 2020 0
Explorer ,
Mar 06, 2020

Copy link to clipboard

Copied

Thank you so much Bernd_Alheit, but here is my screen and what i did:

For_Arial.JPG

 

And for the custom script here is Format page:

 

Format_Page.JPG

 

could there be something i am missing here, i have done everything i have learned from everyone. 

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Mar 06, 2020 0
Explorer ,
Mar 06, 2020

Copy link to clipboard

Copied

Thank you so much Bernd_Alheit, and try67, it has now worked, I used Tahoma font-type and it worked, but there is one more thing here, please how can I introduce separator to the figures, instead of straight digits as it is now, I will like it to read as amount with commas, like N10,000.00 instead of N10000, please I need help to fix that. Thank you so much.

 

Separator.JPG

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Mar 06, 2020 0
Most Valuable Participant ,
Mar 06, 2020

Copy link to clipboard

Copied

Use this code:

 

if (event.value) event.value = "\u20A6" + util.printf("%,0.2f", event.value);

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Mar 06, 2020 1
Deoptic LATEST
Explorer ,
Mar 06, 2020

Copy link to clipboard

Copied

Excellent, it worked perfectly, thank you so much try67, i am very grateful for all your support in this, thanks a lot.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Mar 06, 2020 0