• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Currency followed by a spelled out box of that price...

New Here ,
Jun 09, 2017 Jun 09, 2017

Copy link to clipboard

Copied

I'm trying to put a ($_______) text box followed by a ______________________ Dollars....and I would like the numbers to be translated into the dollars longhand.  Can I do this?

TOPICS
PDF forms

Views

255

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
community guidelines
Guide ,
Jun 09, 2017 Jun 09, 2017

Copy link to clipboard

Copied

You mean: $ 11 will be auto-translated to eleven Dollars ?

1. Which program?

2. Photoshop, InDesign, Illustrator, Acrobat: Never heard of such a feature.

Fenja

Votes

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
community guidelines
New Here ,
Jun 09, 2017 Jun 09, 2017

Copy link to clipboard

Copied

Adobe DC....I was trying to see if that was an option when setting up a form.

Votes

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
community guidelines
Community Expert ,
Jun 09, 2017 Jun 09, 2017

Copy link to clipboard

Copied

Adobe is the COMPANY name... thinking you mean ACROBAT I will move to the PDF Forms section

Votes

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
community guidelines
Community Expert ,
Jun 09, 2017 Jun 09, 2017

Copy link to clipboard

Copied

Assuming you're talking about a PDF file, yes, it's possible to do it using a script.

There are several examples of such scripts on these forums, as well as in other locations on the web.

You basically just need a generic function that converts a number to a string and then to apply it as the custom calculation script of the second field, with the value of the first as its input parameter.

Votes

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
community guidelines
Adobe Employee ,
Jun 12, 2017 Jun 12, 2017

Copy link to clipboard

Copied

LATEST

You can use this script :

var number = this.getField("<TextBoxName>");

event.value = ConvertToWords(number.value);

function ConvertToWords(num)

{

var aUnits = [ "Thousand", "Million", "Billion", "Trillion", "Quadrillion" ];

var cWords = (num >= 1 && num < 2) ? "Dollar and " : "Dollars and ";

var nLeft = Math.floor(num);

for (var i = 0; nLeft > 0; i++) {

if (nLeft % 1000 > 0) {

if (i != 0)

cWords = ConvertToHundreds(nLeft) + " " + aUnits[i - 1] + " " + cWords;

else

cWords = ConvertToHundreds(nLeft) + " " + cWords;

}

nLeft = Math.floor(nLeft / 1000);

}

num = Math.round(num * 100) % 100;

if (num > 0)

cWords += ConvertToHundreds(num) + " Cents";

else

cWords += "Zero Cents";

return cWords;

}

function ConvertToHundreds(num)

{

aTens = [ "Twenty", "Thirty", "Forty", "Fifty", "Sixty", "Seventy", "Eighty", "Ninety"];

aOnes = [ "Zero", "One", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine",

"Ten", "Eleven", "Twelve", "Thirteen", "Fourteen", "Fifteen", "Sixteen", "Seventeen",

"Eighteen", "Nineteen" ];

var cNum, nNum;

var cWords = "";

num %= 1000;

if (num > 99) {

/* Hundreds. */

cNum = String(num);

nNum = Number(cNum.charAt(0));

cWords += aOnes[nNum] + " Hundred";

num %= 100;

if (num > 0)

cWords += " and "

}

if (num > 19) {

/* Tens. */

cNum = String(num);

nNum = Number(cNum.charAt(0));

cWords += aTens[nNum - 2];

num %= 10;

if (num > 0)

cWords += "-";

}

if (num > 0) {

/* Ones and teens. */

nNum = Math.floor(num);

cWords += aOnes[nNum];

}

return cWords;

}

function ConvertToWords(num)

{

var aUnits = [ "Thousand", "Million", "Billion", "Trillion", "Quadrillion" ];

var cWords = (num >= 1 && num < 2) ? "Dollar and " : "Dollars and ";

var nLeft = Math.floor(num);

for (var i = 0; nLeft > 0; i++) {

if (nLeft % 1000 > 0) {

if (i != 0)

cWords = ConvertToHundreds(nLeft) + " " + aUnits[i - 1] + " " + cWords;

else

cWords = ConvertToHundreds(nLeft) + " " + cWords;

}

nLeft = Math.floor(nLeft / 1000);

}

num = Math.round(num * 100) % 100;

if (num > 0)

cWords += ConvertToHundreds(num) + " Cents";

else

cWords += "Zero Cents";

return cWords;

}

Votes

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
community guidelines