Kevin Dangoor <[EMAIL PROTECTED]> writes:

> On 2/13/06, Jorge Godoy <[EMAIL PROTECTED]> wrote:
>> I'll see if I can add a Money validator to TG and then I'll submit it as a
>> patch.
>
> Thanks! I appreciate ensuring that all Money submitted to TG is valid. :)

Take a look at #572 then, please...  I copied parts of the Calendar validator
that was at turbogears.validators and took the simplest approach: replaced all
group separators with nothing and replaced the decimal separator with '.',
then I returned a float.  For the reverse option, I returned
turbogears.i18n.format.format_currency() since it already does the trick.

It is running here.  As a collateral effect, at least for pt_BR, I can type
both '12,00' and '12.00' and it will return the float '12.00'. 

-- 
Jorge Godoy      <[EMAIL PROTECTED]>

Reply via email to