How To Change Currency Format in Gravity Forms

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.

Published by

Leon Quinn

Multimedia Design company in Leitrim, Ireland specializing in WordPress Website Design, Photoshop and Graphics. www.reverbstudios.ie

4 thoughts on “How To Change Currency Format in Gravity Forms”

  1. This is good hack, but 4th line has an error of the double dash `”name” =–> __(“Euro”, “gravityforms”), `

    It should be
    “name” => __(“Euro”, “gravityforms”),

    Like

  2. 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?

    Like

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.