Well, only now I’m trying decimals numbers with Yii.
Here’s my question: In my locale, we use ‘,’ as decimal separator. So, I want my users to insert their number fields with ‘,’, like ‘1234,56’.
Yii gives me an error: ‘it is not a number’. I think Yii internationalization should know that my decimal separator is ‘,’ and convert it to the appropriated number (and do the correct validation). And, if user changes his locale to us, he might enter decimals with ‘.’
I can say the same for dates. In my locale, Yii should understand and convert dates submitted by users in ‘dd/mm/yyyy’ format, automatically. I have seen an idea with behaviors, but my opinion is that Yii should automatically understand and convert its locale data.
You would probably need a custom validator which will let this number format pass.
Then you would have either the validator or a beforeSave callback (which could be in a behavior) change the values to what you need them to be in the database