Mon. - Fri. 9 am - 5 pm Ask a Question
Remember me

Comma instead of point

1 week 3 days ago #1

  • Andreas's Avatar
  • Andreas
  • Posts: 8
Hello,
In germany and in hole Europe we use a comma instead of a point for money values. For example 12,34€. But But the text input field only allows a point.

How can I fix this? I want to calculate with the values.

Thank you very much
Andreas

1 week 3 days ago #2

  • Vyacheslav's Avatar
  • Vyacheslav
  • Posts: 24808
Hello,
Thank you for contacting us

What type of field are you using.
Send us a link to the page with the problem

Best Regards,
Vyacheslav, Balbooa Support Team

1 week 3 days ago #3

  • Andreas's Avatar
  • Andreas
  • Posts: 8
Its an Input field type 'text' I can't send you a link because the page is hidden now. Access only with admin password.

The input of a comma is not possible.

1 week 3 days ago #4

  • Vyacheslav's Avatar
  • Vyacheslav
  • Posts: 24808
We checked everything is working well


you can check our showcase
www.balbooa.com/showcase/extension/forms

Regards,
Vyacheslav, Balbooa.com

1 week 3 days ago #5

  • Andreas's Avatar
  • Andreas
  • Posts: 8
Ok, I have had a seccond look and I had the format 'number'. This format only works with points.

Now I can input currency values with a comma. BUT the calculation of the values don't work with comma inputs. The result is 0,00 every time. Please see the hardcopy.

1 week 3 days ago #6

  • Vyacheslav's Avatar
  • Vyacheslav
  • Posts: 24808
This is necessary for the mathematical functions to work (there is no way to use a comma)
developer.mozilla.org/en-US/docs/Web/Jav.../Global_Objects/Math

Regards,
Vyacheslav, Balbooa.com

1 week 3 days ago #7

  • Andreas's Avatar
  • Andreas
  • Posts: 8
Yes, but this is not ok for a practical use here.

In whole europe everyone is using a comma for currency inputs.

I have bought balbooa only for this feature. And now I can't do that simply addition?

Is there a way to fix or convert the input before calculating?

1 week 3 days ago #8

  • Vyacheslav's Avatar
  • Vyacheslav
  • Posts: 24808
You need in file ba-form.js(components/com_baforms/assets/js/ba-form.js)
find
fields[id].price = $this.value * 1;
and replace to
fields[id].price = $this.value.replace(/,/g, '.') * 1;

Best Regards,
Vyacheslav, Balbooa Support Team

2 days 6 hours ago #9

  • Andreas's Avatar
  • Andreas
  • Posts: 8
This is no solution. If I enable "Überprüfung" (validation) to 'number' it don't work again. It takes only a point and typing a comma is not possible.

I can't understand why this elemental thing is not an option. For example an option 'european format' or so.
Powered by Kunena Forum