hi guys, in germany we use comma instead of dot as separation mark for decimal numbers, so is it possible to provide the option to use comma, when enabling decimal numbers for any given product type?
thx in advance

Comments

guy_schneerson’s picture

Assigned: ciniko » Unassigned

Hi @ciniko
Thanks for bringing this up, will look into it.
Do you know if their are any Drupal configuration related to number formats anywhere on a Drupal site?

guy_schneerson’s picture

Any ideas?

We can create configuration options for all known number formats see http://en.wikipedia.org/wiki/Decimal_separator or look at the module http://drupal.org/project/format_number

We can also add validation to the forms to make sure it is entered in the correct way and possibly convert it to a format that commerce can handle before its submitted.

What about the line item Quantity formatter?

jasminedb’s picture

Hello,
May I ask if you have found a way to solve this problem? it's rather confusing for the customer to have to enter quantities with decimal dots and to see the prices with decimal commas.
For the moment I did state clearly how they should enter the quantities, but many surfers don't really read what's on a page....

guy_schneerson’s picture

Hi jasminedb
Sorry I haven't got around to this, will try and have this resolved in the next few weeks.

iaugur’s picture

This is a common issue when dealing with decimal validation on international sites.
The following issues have addressed this and may be relevant here (I haven't looked into them in any depth)

Drupal Commerce
#1450736: Support for currency decimal separator as decimal delimiter for field input - see Googletorps comment/patch at #4
Webform
#1813200: Validation of field type number fails for decimal separator - see sidharthap comment - also #4 ; p

guy_schneerson’s picture

Status: Active » Needs review
StatusFileSize
new2.27 KB

Attached is a patch that uses the format_number module.
If the format_number is enabled all quantity edit fields will use the decimal separator defined by the format_number module.

@ciniko & @jasminedb : if you install format_number and configure the decimal point in admin/config/regional/format_number this should hopefully fix the issue for you

@iAugur I like the idea of a common module providing this functionality and will look at your links to see if it has relevance for commerce & webforms, I am a bit concerned however about the maintenance state of number_format as no commits for the last year.

guy_schneerson’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.