Skip to content Skip to sidebar

This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

Sun Mon Tue Wed Thu Fri Sat
10:00 – 14:00 10:00 – 14:00 10:00 – 14:00 10:00 – 14:00 10:00 – 14:00 - -
16:00 – 20:00 16:00 – 20:00 16:00 – 20:00 16:00 – 20:00 16:00 – 20:00 - -

Supporter timezone: Asia/Jerusalem (GMT+03:00)

Tagged: 

This topic contains 9 replies, has 1 voice.

Last updated by Itamar 4 weeks, 1 day ago.

Assisted by: Itamar.

Author Posts
July 31, 2025 at 7:11 am #17283806

Ton

Background of the issue:
I am trying to calculate a price for a form using Gravity Forms in EUR format (€ 2,50). I found an issue where the decimal is ignored, rendering the price as € 2,00 on the front-end.

I looked into the code and errata and found this link: https://wpml.org/errata/gravity-forms-option-pricing-field-loses-price-and-currency-with-woocommerce-multicurrency/.

But this would set the price always to 0,00.

I found that the fix was to remove the floatval from this function, but i do not know the further implications of the change:
private function getRawPrice( $price ) {

$price = preg_replace( [ '~&.*?;~', '~[p{Sc}s]+~u' ], '', $price );

return floatval( trim( $price ) );
}

Symptoms:
The price with a decimal in EUR format (€ 2,50) is ignored, rendering as € 2,00 on the front-end.

Questions:
How can I ensure the decimal in EUR format is correctly displayed?
Is there a known fix for this issue with Gravity Forms and WPML?

July 31, 2025 at 7:32 am #17283930

Ton

So the problem lies in the fact that I want to use a , as a decimal seperator and a . as a thousand seperator. Wich is the common way in Netherlands.

For now i changed it to using the . as the decimal seperator.

But this should get sorted.

July 31, 2025 at 7:34 am #17283934

Dražen
Supporter

Languages: English (English )

Timezone: Europe/Zagreb (GMT+02:00)

Hello,

Thank you for reaching out to us.

While my colleague reviews your ticket, I’d be happy to assist you in the meantime.

Could you please confirm whether you’ve tried the solution provided on the errata page? If it resolves the issue, we recommend following the steps outlined there until a permanent fix is released.

The fix is currently scheduled for inclusion in GFML 1.9.0.

Please let us know how it goes.

Best regards,
Drazen

July 31, 2025 at 12:56 pm #17285093

Ton

Hello Drazan,

Yes I tried that as I said in the first comment and it even breaks the form even more. In stead of the €2,50, I get 0 than, so i did not end up using that.

But my issue is not that it loses the price. Instead it changes it, because of the comma (,) decimal (wich is common in Netherlands). So € 2,50 becomes €2,00 if GFML is enabled.

So the issue is that you can not use a comma (,) in a price in GF when GFML is active, because of the floatval in the function.

For now I fixed it by using the period (.) as the decimal seperator. But I should be able to use a comma (,) as the seperator too.

Hope it is clear what the issue is.

For the next 3 weeks I will be on vacation, so might be a while before I reply back again.

Kind regards
Dennis

August 4, 2025 at 8:47 am #17292249

Itamar
WPML Supporter since 02/2016

Languages: English (English )

Timezone: Asia/Jerusalem (GMT+03:00)

Hi,

I'll continue to help you with this issue.

It might be that you are reporting a new issue or an extension of the known problem. We need to replicate this issue on a fresh WordPress installation. Then I'll be able to escalate it to our compatibility team. For this, I created a test website with a clean WordPress install. You can access it through this link:

hidden link

With this link, you'll be directly logged in.

I've configured WPML to have Dutch as the default language and English as the second language. Also, the Gravity Forms plugin is installed (but not active yet.)

Please Gravity Forms and WooCommerce as set on your site (just the basic configurations needed to replicate the issue are enough).

When everything is finished and you can replicate the problem, please let us know.

Important! Do not import your site to the test site. We must replicate the problem on a fresh, clean WordPress installation.

I'm setting this ticket as escalated to our second-tier supporters to prevent it from being closed, as you mentioned you'll be on vacation for 3 weeks. If the sandbox site is not active when you check it, please let me know.

Enjoy your vacation,
Itamar.

August 27, 2025 at 9:30 am #17351028

Ton

It says: Your sandbox has expired

August 31, 2025 at 7:23 pm #17360890

Itamar
WPML Supporter since 02/2016

Languages: English (English )

Timezone: Asia/Jerusalem (GMT+03:00)

Hi,

Our sandbox system automatically removes unused sandbox sites that have not been accessed for over a week.

We have recently released new versions of our plugins. Please update WPML and its add-ons, as well as the Gravity Forms plugins, to their latest versions and check if the issue has been resolved. You can see that we have new versions by clicking the Check for updates button on your site here: hidden link.

If the problem persists, then here is a new sandbox site you can use:
hidden link

Regards,
Itamar.

September 3, 2025 at 5:59 am #17368126

Ton

It seems like everything is good now when I use a COMMA (,) for my prices and calculations. So the update must have fixed it.

September 3, 2025 at 6:05 am #17368128

Ton

Sorry, i looked wrong. It still is not working with a 57,50 for example.
It only works with 57.50.

September 3, 2025 at 6:35 am #17368186

Ton

So I tried to reproduce the bug, but I cannot. In the sandbox everything seems to be OK even with decimals.

I THINK the only difference I have is I have Spellbook (gravity wiz) ecommerce fields as addon?

September 3, 2025 at 9:06 pm #17372621

Itamar
WPML Supporter since 02/2016

Languages: English (English )

Timezone: Asia/Jerusalem (GMT+03:00)

Hi,

We suspect a collision with the theme or another plugin might cause this problem. If possible, get your site into a minimum environment, switching to a default WordPress theme like TwentyTwenty-Four and having no plugins activated except WPML.

First, you must check if the problem persists when just the theme is switched to TwentyTwenty-Four (for example). If the issue persists, deactivate all plugins except WPML and its add-ons, as well as Gravity Forms without any extensions (especially without the GP eCommerce Fields plugin). Then, please check if the problem persists. If the issue does not continue, start by activating the plugins individually and check when the issue comes back; then report to me which plugin was the culprit.

**** Important! Please make a full site backup (files and DB) before you proceed with those steps****


If your site is live, consider trying those procedures in a staging environment, a snapshot of your site on your local server, or another server. ***

Regards,
Itamar.

The topic ‘[Closed] Gravity forms multilingual no decimals in EUR format like (2,50)’ is closed to new replies.