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.

Advertisements