As great as the number one WordPress forms plugin is, Gravity Forms has one glaring omission – no front end settings for currency formatting. The default you’re stuck with it this:
100,00 € which is supposed to denote one hundred euros or €100. This can confuse some people who mistake it for one hundred thousand!
The only way to change it is by adding the following code to your themes “functions.php” file. This example is what you need to show currency in Euros with the € symbol on the left, a comma thousand separator and 2 decimal places:
add_filter( 'gform_currencies', 'update_currency' ); function update_currency( $currencies ) { $currencies['EUR'] = array( 'name' => __( 'Euro', 'gravityforms' ), 'symbol_left' => '€', 'symbol_right' => '', 'symbol_padding' => ' ', 'thousand_separator' => ',', 'decimal_separator' => '.', 'decimals' => 2 ); return $currencies; }
NB: making this change may change any existing prices you have on your form to thousands so you’ll need to go into each price and fix.
Thank’s for your help !!
Remove the two zero after the “,” = a way better presentation for users !!
LikeLiked by 1 person
This worked for me. Thanks!
LikeLiked by 1 person
This is good hack, but 4th line has an error of the double dash `”name” =–> __(“Euro”, “gravityforms”), `
It should be
“name” => __(“Euro”, “gravityforms”),
LikeLiked by 1 person
Thank you for this. I’m trying to customize a “Number” field as well, but differently. I am looking to remove the thousand-separator completely. Should I use this or is there a better/simpler way to do it?
LikeLiked by 1 person
I’m no expert I’m afraid but a variation of this code should work I presume..
LikeLike