IS_DECIMAL_IN_RANGE and IS_FLOAT take a an attribute called dot="."
which you can internationalize
IS_DECIMAL_IN_RANGE(dot=T("."))
On Jun 29, 5:39 am, tomtom5 <[email protected]> wrote:
> I'm currently diving into web2py and got a problem localising input/
> output of Decimal/Double form fields according to the users (browsers)
> locale. I understand the mechanism of internationalising messages with
> T(..), but that doesn't seem to help me further. What I need is, that
> for example a german user may input a decimal value as 123.456,78
> while an american user will use 123 456.78 as input/output format. I
> found methods to define the decimal separator char in the constructor
> of the IS_DECIMAL_IN_RANGE validator, but this is very rudimentary and
> will not be user-locale aware. Is there a way to solve the problem out
> of the box or should I create new validators or widgets for such a
> task?
> Thanks for advise