Format to Always Output Number with 2 Decimals

December 12, 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).
December 12, 2018 18:35:42
E2Pdf
Topics: 7
Messages: 3617
Support
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!
December 12, 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!
December 12, 2018 19:10:35
E2Pdf
Topics: 7
Messages: 3617
Support
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!
December 12, 2018 19:20:59
jstraete
Topics: 34
Messages: 111
Ok perfect, thank you for all your help!
December 17, 2018 14:22:01
E2Pdf
Topics: 7
Messages: 3617
Support
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!
December 17, 2018 17:07:08
jstraete
Topics: 34
Messages: 111
I just ran a test and it looks like this works! Thanks!
Get News and Updates
Our monthly newsletter keeps you in the loop, so you'll always be up to date with the latest news and updates about E2Pdf.
* You can update your email subscription preferences here.
All trademarks, service marks, trade names, product names, and logos appearing on this website are the property of their respective owners. The use of trademarks such as Formidable Forms®, Forminator Forms®, Gravity Forms®, JetFormBuilder®, WordPress®, WooCommerce®, WPForms® and others is solely for identification purposes (nominative use) and does not imply any affiliation, sponsorship, or endorsement by the respective trademark holders.
© 2017 - 2026, https://e2pdf.com

We use cookies to collect and analyse information on site performance and usage, to provide social media features and to enhance and customise content and advertisements. By clicking "Accept Selected", you consent to use of selected cookies according to our Cookie Policy.