Format to Always Output Number with 2 Decimals

12 December, 2018 18:15:49
jstraete
Topics: 34
Messages: 111
Is there a way to format a Formidable Form field always output a number with 2 decimal places? For instance, if field [100] = 300.4, is there any syntax so that it appears on the PDF generated as 300.40? If not, I'll check with Formidable Forms support on how to get the number to store in the database with 2 decimals (I do have the field set to 2 decimals in Formidable Forms, but that must only round the number to 2 decimals if the calculation has more than that).
12 December, 2018 18:35:42
E2Pdf
Support
Topics: 7
Messages: 3335
Hi,

You can use shortcode:
[e2pdf-format-number decimal='2'][100][/e2pdf-format-number]

It must do the job. More options that can be set you can find here.

P.S. Keep in mind please that repeatable fields not supported at this moment by [e2pdf-format-number] shortcode.

We remain at your service.
We would really appreciate your feedback at WordPress.org!
12 December, 2018 18:50:23
jstraete
Topics: 34
Messages: 111
Ok, I was just trying to figure out why when doing something like $[e2pdf-format-number thousands_sep="," decimal='2'][143:1][/e2pdf-format-number] the only thing that was getting outputted was $. If the shortcode could be made to work on the repeating fields that would be very helpful for some templates I'm working on putting together. I'll just have to leave the shortcode off on those fields in the meantime. Thanks for all your help!
12 December, 2018 19:10:35
E2Pdf
Support
Topics: 7
Messages: 3335
We plan to include support of repeating fields in the next update as it's ready but it must pass some tests.

We will update this thread as soon as it will be released.

We remain at your service.
We would really appreciate your feedback at WordPress.org!
12 December, 2018 19:20:59
jstraete
Topics: 34
Messages: 111
Ok perfect, thank you for all your help!
17 December, 2018 14:22:01
E2Pdf
Support
Topics: 7
Messages: 3335
We just released an update (1.03.02) which allows using [e2pdf-format-number] with repeatable fields.

We remain at your service.
We would really appreciate your feedback at WordPress.org!
17 December, 2018 17:07:08
jstraete
Topics: 34
Messages: 111
I just ran a test and it looks like this works! Thanks!