How to Add Three Decimals with Gravity Form Currencies
Most default currencies in Gravity Forms will be set to two decimal places. If you need to change this to three decimal places, or some other number, this guide will show you how.
Gravity Forms provides support for a variety of currencies out of the box and allows you to change the currency for your forms on the Gravity Forms settings page.
Most default currencies will be set to two decimal places but what if you need to change this to three decimal places or some other number?
Enter the gform_currencies
filter! This handy little snippet will allow you to select a currency and change the number of decimals used when working with the specified currency.
In the example above, we are using the Euro (EUR) but you can replace this with any of the supported currencies. For a full list of Gravity Form Currencies please see our article on Gravity Form Currencies.
Bulk Pricing
Using three decimals is commonly used with bulk pricing. This means the more you buy the cheaper the per unit cost. If you’re looking for a simple way to setup bulk pricing, check out our powerful pricing plugin, GP Conditional Pricing
Hi there. Thanks for the code. Could you please let me know if there’s a way to apply this filter to a specific form? (as opposed to all forms on the site). Thanks again.
I don’t believe the gform_currencies filter supports applying it to a specific form. I recommend reaching out to Gravity Forms support to see what they have to say.
Where should I add this code?
This would go in your theme’s functions.php file.
I have a problem with the number of decimals in the gravity ,single product, Can I increase the number of decimal places by adding this code?
Hi,
I am using this filter and it works so far. The price in single additional options is displayed without decimal. But the calculated total price in css class .formattedTotalPrice and ginput_total still shows 2 decimals. It seems that no filter out there is able to access this price. Do you know more about that?
Hey Max, I’m not aware of a solution for this one. I’d love to know what Gravity Forms support has to say.
Hi wiz, I’m using this code and it works fine, but now in the calculating fields the prices show up also with 5 decimals, is there a way to fix that. like a filter that only targets the calculation fields to round up 2 decimals. from 23,34667 to 23,35.
Help needed.
Hi Philip, I’d reach out to GF support on this one.