The node edit form shows a comma instead of a decimal point for the input field of default values, like this:

Total Due:
USD: 0,00
Use "." as the decimal separator and (optionally) "," as the digit group separator. You can only enter two decimals.

I need that the comma to be a decimal, which I've already specified as indicated in the text below the USD amount.

How do I fix this?

Thanks!

Comments

ifanlo’s picture

Hi,
(sorry for my English, I'm spanish speaker) :-(

A similar problem:

my settings:
decimal separator: , (comma)
digit group separator: . (dot)

When I edit the form, the message is right:
Use "," as the decimal separator and (optionally) "." as the digit group separator. You can only enter two decimals.

But, if I introducing 24,70
when I save the form, transformed in 2.470,00

The only solution it's to setting the dot for decimal separator and the comma for group separator, what not it's right for the frame cultural of my users.

Thanks,

amontero’s picture

Title: comma not decimal point » I think it's a "number_format($item['amount']/100" issue

I've inspected the code in order to add my two cents and that's what I found:
There are several places where this code appears: "number_format($item['amount']/100".
I think this behaviour it's caused by two factors:
*Dividing the number previous to formatting leaves to PHP the sorting out of dot and comma. I'm not sure of how it might handle this for non-US formattings. It may even depend on PHP locale.
*number_format function has issues when dealing with dot and comma with formats other than US as seen in the PHP site documentation (specially in the user comments).

IMHO, will be better to strip any thounsands separator before doing the math and formatting. Also, replacing the decimal point by one that works for sure with number_format (it expects a float) may be necessary.
Otherwise, the same issue appears for me with currency formattings other than US.
Thanks.

wim leers’s picture

Status: Active » Closed (fixed)

I think you're not quite understanding what's happening:

When I edit the form, the message is right:
Use "," as the decimal separator and (optionally) "." as the digit group separator. You can only enter two decimals.

But, if I introducing 24,70
when I save the form, transformed in 2.470,00

2.470,00 *is* correct when you use "," as the decimal separator and "." as the digit group separator.