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

Learn more

View all

Sign in to view all badges

Calculating a field that needs to be text

Jen_Sav
Level 2
Level 2

Hi,

I am wondering if anyone knows of a way to add a text field into a calculation?

I have a column of fields that need to state a rate per hour but that field needs to be included into an amount column that calculates teaching hrs x rate per hour. How do i get to have the rate per hour field as a text field and included into the calculation?

Or if there is another object i can choose to allow me to do what i need to.

Thanks

Jennah

0 Replies
Niall_O_Donovan
Level 10
Level 10

Hi,

You should keep the objects as numericfields and then apply a pattern in the Object/Field tab that includes the text label that you want to follow each number. This way the user will see the label, but the calculations will only use the numbers.

Parallels DesktopScreenSnapz004.png

First you add the data pattern you want for the object and then you add the label using single quotes. The additional bits you add to the standard patterns are shown in red.

The pattern for the teachers' hours would be num{z,zzz,zzz,zz9' hrs'}

The pattern for the rate would be num{$z,zzz,zz9.99' rate/hr'}

Hope that helps,

Niall

Jen_Sav
Level 2
Level 2

Hi Niall,

Thank you, it does help for others forms i will have to create but for this one in particular i need to have the rate per hour fields as a field that displays the text, we dont want them to enter the $100.00 for the per hour rate.

Does that help a little more in what i need fixed???

Thanks.

Niall_O_Donovan
Level 10
Level 10

Hi,

Here is an amended sample. I don't think it is possible to do what you want, if I understand your requirement correctly.

There is a FormCalc function called Wordnum(), which will change a number into an english text string. There is a sample of this in the form, where you put in a rate in the left hand field (number) and the rate appears in text in the right hand field. However I do not know how to get the total calculation to deal with a text string.

The only other (messy) option is to use a dropdown, with specified values in the Object/Binding tab. Here the user sees set rates in text, but behind the scenes Acrobat sees numbers.

Parallels Desktop.png

Hopefully someone else will have a more elegant solution.

Good luck,

Niall