How do I move the currency symbol from the right to the left for Gravity Forms?

April 11th, 2023: Simplified snippet to be more future-proof.

October 2nd, 2015: Fixed typo. Parenthesis replaced with curly brace.

Getting Started

  1. Install the snippet

    • Copy and paste the entire snippet into your theme’s functions.php file or install via a code snippet management plugin like Code Snippets.
  2. Configure the snippet

    • This snippet moves the Euro’s currency symbol to the left by moving the symbol’s HTML entity from the “symbol_right” property to the “symbol_left” property.
    • If you’d like to apply this to a different currency you will need to change the 'EUR' on lines 7 and 8 to the appropriate abbreviation for your desired currency. See the tip below for an easy way to find out the correct abbreviation.

For a list of default Gravity Forms currencies and an overview of the available currency parameters, check out the resource.

Any questions?

What else do you need to do with Gravity Forms currencies? Let us know in the comments!

Comments

  1. Vitaljik
    Vitaljik February 13, 2023 at 7:27 am

    I believe you should update the last line now like this, otherwise it stopped working:

    add_filter( ‘gform_currencies’, function( $currencies ) { $currencies[‘EUR’] = array( ‘name’ => esc_html__( ‘Euro’, ‘gravityforms’ ), ‘symbol_left’ => ‘€’, ‘symbol_right’ => ”, ‘symbol_padding’ => ‘ ‘, ‘thousand_separator’ => ‘.’, ‘decimal_separator’ => ‘,’, ‘decimals’ => 2, ‘code’ => ‘EUR’ ); return $currencies; } );

    Reply
  2. Harriet
    Harriet May 4, 2022 at 11:26 am

    Hi,

    WPML checks the language with ICL_LANGUAGE_CODE:

    if (ICL_LANGUAGE_CODE == ‘en’)

    So I need to have the code to check if the language is EN, then

    ‘symbol_left’ => ‘€’, ‘symbol_right’ => ”, ‘symbol_padding’ => ‘ ‘, ‘thousand_separator’ => ‘,’, ‘decimal_separator’ => ‘.’, ‘decimals’ => 2

    ELSE (with our other languages)

    ‘symbol_left’ => ”, ‘symbol_right’ => ‘€’, ‘symbol_padding’ => ‘ ‘, ‘thousand_separator’ => ‘.’, ‘decimal_separator’ => ‘,’, ‘decimals’ => 2

    What would be the correct code for this language check? I almost got it right, but not totally working or giving errors.

    Also, I noticed that if I change the settings above my product option price changes in the form from €0.20 (EN is the default language) to 20,00€. That is strange?

    Thanks in advance.

    Reply
    1. Dario Space
      Dario Space Staff May 4, 2022 at 11:36 am

      Hi Harriet,

      This is not currently supported and it will probably need a little tweak of the snippet. If you have an active Gravity Perks license, can you get in touch with us via our support form? About the currency symbol being moved and changing the price I’ll suggest you get in touch with Gravity Forms support team on this.

      Best,

  3. Linda Ahlblad
    Linda Ahlblad April 29, 2022 at 10:20 am

    Hi,

    this is great. But how about changing the currency sign placement and separator according to the site language (WPML)?

    We have 3 languages: the default is EN (en_US) and the others are Finnish FI (FI) and Swedish SV (sv_SE).

    We use the language code in the url, like default.com, default.com/fi, default.com/sv

    In Finnish and Swedish the price should be 25,50€ and in English €25.50

    Thanks in advance.

    Reply
    1. Dario Space
      Dario Space Staff April 29, 2022 at 10:44 am

      Hi Linda,

      This is not currently supported and it will probably need a little tweak of the snippet. You could contact WPML to see if there’s a way to check which lang is rendering and add an IF/ELSE condition to the snippet so it applies differently to each language.

      I hope this helps.

  4. Nahuel Torres
    Nahuel Torres April 20, 2022 at 8:45 pm

    Well, it was a life saving. Until I realized I changed all price fields. I’m trying to include “+ shipping” in total price; but I want to hold the XX,XX € in the rest of prices showed in my form.

    Any way to point this snippet to a specific field in a specific form??? Thanks for your cooperation, love perks!

    Reply
    1. Samuel Bassah
      Samuel Bassah Staff April 21, 2022 at 6:12 am

      Hi Nahuel,

      Unfortunately no. The Gravity Forms currency setting is sitewide and affects every form and field.

      Best,

  5. Mart
    Mart May 22, 2019 at 8:02 am

    Hi Do you know how to hide the currency symbol all together when using a product field,

    The problem we have is we sell in £$€ and hard code this to emails notifications, and just need to remove the currency symbol all together

    Reply
    1. David Smith
      David Smith Staff May 22, 2019 at 9:40 am

      Hi Mart, try removing the value for “symbol_right” and “symbol_left”.

  6. Niall Flynn
    Niall Flynn March 3, 2017 at 5:40 am

    I tip my hat again Sir, FYI Euro standard is a . as a currency separator and , as a thousand. The code above has them flipped. Below is the format for a Euro total field like (€ 0.99 or € 1,000.99)

    Reply
    1. David Smith
      David Smith Staff March 3, 2017 at 8:18 am

      Hi Niall, I’m no expert on this subject, but my understanding is that you can format the Euro either way depending on your country. Most European countries appear to use the dot for thousands and the comma for decimals.

      Also, this snippet doesn’t actually change the decimal or thousands separators from that which is included in core by default for the Euro.

      Definitely open to new information on this subject. :)

  7. Richard
    Richard April 11, 2016 at 2:50 pm

    I was just browsing all the goodies on the site and stumbled upon this one, works like magic. Real easy! Just wanted to thank you!

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *

  • Trouble installing this snippet? See our troubleshooting tips.
  • Need to include code? Create a gist and link to it in your comment.
  • Reporting a bug? Provide a URL where this issue can be recreated.

By commenting, I understand that I may receive emails related to Gravity Wiz and can unsubscribe at any time.

Grab a bundle of free Gravity Forms plugins

Enter your email and receive our most popular free plugins and snippets, plus access to hundreds of others.

This field is for validation purposes and should be left unchanged.