• Home
  • Pricing
  • Free Resources
  • About
  • Docs
  • Support
  • Account

Gravity Wiz

Magically enhanced tutorials, snippets and plugins for Gravity Forms!

  • Gravity Perks
    • Gravity Perks
    • Pricing
  • Blog
    • Free Resources
    • About
  • Support
    • Docs
    • Support
    • Account

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

A simple snippet to move currency symbol from the left to the right of the currency amount.

Last updated March 17, 2021 | Written by David Smith 16 Comments

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

View CodeDownload Code

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 line 9 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 Gravity Forms Currencies resource.

Any questions?

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

Filed Under: Uncategorized currency

Comments

  1. Harriet says

    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
    • Dario Space says

      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,

  2. Linda Ahlblad says

    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
    • Dario Space says

      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.

  3. Nahuel Torres says

    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
    • Samuel Bassah says

      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,

  4. Jo says

    February 7, 2022 at 11:12 am

    Thank you for this!

    Reply
  5. Bert Schipperijn says

    January 2, 2021 at 8:47 am

    Thanks! Still working

    Reply
  6. Mart says

    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
    • David Smith says

      May 22, 2019 at 9:40 am

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

  7. Niall Flynn says

    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
    • David Smith says

      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. :)

  8. Richard says

    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
    • David Smith says

      April 11, 2016 at 8:13 pm

      Glad you’re digging the site, Richard. Make sure you check out Gravity Perks too. :)

  9. Bob says

    October 2, 2015 at 10:15 pm

    There’s a typo in the last line – should be no ), but a closing }.

    Reply
    • David Smith says

      October 2, 2015 at 11:55 pm

      Thanks, Bob! Fixed.

Leave a Reply Cancel reply

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

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

Recent Posts

  • Introducing Page Transitions 1.0 📖
  • Gravity Forms QR Code turns 1.0 🎉
  • How to Filter One Field By Another and Create Gravity Forms Chained Selects
  • Gravity Forms OpenAI
  • Spotlight: One Perk for 25,000 Pricing Levels with WP4Geeks

Categories

  • How To (78)
  • News (25)
  • Plugins (21)
  • Releases (18)
  • Resource (4)
  • Snippets (54)
  • Spotlights (18)
  • Tutorials (58)
  • Updates (176)

Meta

  • Log in
  • Entries feed
  • Comments feed
  • WordPress.org

Copyright © 2023 · Powered by WordPress · Gravity Wiz LLC

  • Support
  • Affiliates
  • About
  • Sitemap
  • Terms & Conditions of Use
  • Privacy Policy
  • Cookies Policy