hello,
to display the right price in the checkout with a comma, we have use the dot in the event editor. as a separator.
that´s uncomfortable. Our customer needs to use the comma. With a dot, the price ist not showing right in the checkout…
cy.

hello,
to display the right price in the checkout with a comma, we have use the dot in the event editor. as a separator.
that´s uncomfortable. Our customer needs to use the comma. With a dot, the price ist not showing right in the checkout…
cy.

Hi Cy,
This option is available for MEC:

Is this not working on your site? Can you give us more information about the issue? Also it would help if you can share your site url and credentials inside a secure note so we can directly check. Thank you.
not, this is not working…see secure note above.
Hi @cyrock,
I’m a bit confused, the comma is a thousand separator then dot is for decimal, in your screenshot it’s not thousand but 17.50 which is decimal. Do you mean the decimal separator should be a comma too? Like what if the price is 3,232,50 and there will be 3 thousand 2 hundred thirty two and 50 cent? I think that’s going to be a bit more confusing as it will appear million.
But since ticket price is manually added instead of calculator then yes, you’ll have to manually add the add. It’s also displaying okay on the checkout.
It is displaying the comma due to the setting

Though, whichever the preference, they are needed to manually add to the ticket price.
Thanks!
Hi, thanks for responding!
In Europe the comma is the decimal separator and we dont use thousands separator.
If you set a comma in the event editor it cuts behind the comma and shows only 17,00 €. So we have to use the dot in the event editor to show the right price, only then it displays the comma in the booking-checkout.
The user who will operate the system later will never get this in his brain…
I know, its confusing…Thanks anyway 
cheers
Cyrock:
You are most welcome!
Hi,
The problem is not solved yet. It is important for us and the future user that the semantic use is secure. Please make sure that the use of the comma is fluent from backend to front end…
Mec is basicly the best booking tool, but it has so many little hooks and bugs.
“He kicks with his butt, what he build up with his head.” German meaning.
Thanks cy.
Hi @cyrock,
I see, thanks for the explanation. In that case, the thousand should be the dot and comma is going to be decimal. Then I changed the dot to comma

And viewed the checkout and it displays correctly with added comma.

Based on the comma requirement, it seems to be working.
Thanks!
hi,
i tried but no chance…not working

Hi @cyrock,
I’m able to reproduce that now and it’s weird it was working. Unfortunately, the issue is in the core which parses the string number back to its original number. And since a comma isn’t really a part of decimal (as of PHP standard) then I can’t provide any workaround but to add it with dot as decimal separator.
public function render_price($price)
{
// return Free if price is 0
if($price == '0') return __('Free', 'mec');
$thousand_separator = $this->get_thousand_separator();
$decimal_separator = $this->get_decimal_separator();
$currency = $this->get_currency_sign();
$currency_sign_position = $this->get_currency_sign_position();
// Force to double
if(is_string($price)) $price = (double) $price;
$rendered = number_format($price, ($decimal_separator === false ? 0 : 2), ($decimal_separator === false ? '' : $decimal_separator), $thousand_separator);
if($currency_sign_position == 'after') $rendered = $rendered.$currency;
else $rendered = $currency.$rendered;
return $rendered;
}
This one is the cause if(is_string($price)) $price = (double) $price;, the casting of string to double in which disregard anything that isn’t part of a number (which is the comma).
You may want to edit this file \wp-content\plugins\modern-events-calendar\app\libraries\main.php directly and change that line to something like this
if(is_string($price)) $price = floatval(str_replace(',', '.', str_replace('.', '', $price)));
But, it may not work.
Thanks!
hi, thanks for researching
yes right. not working. Sad, because the project is close to final.
The developer should fix this massive and embarrassing bug asap!
The whole EU is using the comma for decimal and it´s an eu-rule.
Thanks,
cy.
Hey CY,
I’ll post this in our issue tracker so the person managing the bundled plugins could report this to the MEC developers.
Thanks for reporting.
Hi, there were two updates, but no one cares about the wrong decimals. It´s a credendial function and a deeply bug which should be solved… What´s wrong!?
regards,
cy.
Hello Cy,
We are really for the inconvenience. I can see this is already reported on the plugin developer. Although this is bundled with the theme, it’s main functionality adjustment still needs to be forwarded to the plugin developer. We do communicate the with them regarding the issue but the fixed will still come from plugin developer. Thank you for understanding.
This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.