I have set up a integer field limited between 0 and 10.

Then when I try to enter 0,1 or 0,56 which are not integers, the validation process remove the comma during the preview instead of telling me that the number I enter should be an integer.

CommentFileSizeAuthor
#4 number.module.decimal.diff1.76 KBBèr Kessels

Comments

julma’s picture

Just thinking that in english the separator is a point whereas it is a comma in french. However the problem remains with a point.
Itcould be nice to think the validation process for french and as many langages as possible.

BobLouis’s picture

Indeed in many European coutries, the comma [,] is the decimal separator, and not the dot [.].
This is not taken into account by the module, although the issue was raised here for Drupal 4.7: http://drupal.org/node/118364
Is there an equivalent solution for Drupal 5.x?

Bèr Kessels’s picture

Status: Active » Needs work

A ported and slightly altered version of the http://drupal.org/node/118364 patch, for Drupal 5.

Needs work, because:
- we must support thousands-separators.
- this is an ugly solution: the preg_replace pattern should rather be altered based on the separator.
- We should also support thousands separator.

All in all: the number module's decimal support needs rethinking. In the mean time this patch may help a little.

Bèr Kessels’s picture

StatusFileSize
new1.76 KB

.. and the patch.

Oh, and I need to add: we abandoned this in favor of a simpler solution: textfield for price info. So I won't be the one working on this patch (hint :))

karens’s picture

This all works differently in D6 where we allow you to define the elements to use for separators. Once the D6 work is done we can come back and try to backport some of it to D5.

karens’s picture

Status: Needs work » Closed (won't fix)

This won't get done for D5.