Page 1 of 1

Value of numeric fields rounded on New Record

PostPosted: Fri Aug 05, 2011 2:25 am
by silma
Hello Steve, hello everybody,

I'm experiencing a strange behaviour in my app : Sometimes, when users insert a new record, a field with numeric value will be rounded.

IE, in an invoice table, i've got a "consumption" field : If i put "1563.32" inside and save ,the recorded data will be 1563.00.

However, it once happen on 15 , or 50, or 100, randomly, and i can't find why. The values are similar to others.
Users told me that it happened since the beginning, on all the numeric fields.
I didnt noticed it before because it wasn't critical... except for consumption in tons !

Has anybody experienced the same thing ?
I'm using Xataface 1.3rc4 (I'll do the update next week, thanks for the release Steve)

Thanks a lot for your help.

Silma

Re: Value of numeric fields rounded on New Record

PostPosted: Fri Aug 05, 2011 5:17 pm
by shannah
What kind of field/widget is this using?

Re: Value of numeric fields rounded on New Record

PostPosted: Sun Aug 07, 2011 11:39 pm
by silma
Hello,

They all look like this :

Code: Select all
[Consommation]
widget:label = "Consommation"
widget:description = "Consommation totale pour la période."
validators:regex = "/^.{0,11}$/"
validators:numeric = true
validators:regex:message = "Le champ Consommation doit être composé de chiffres."
validators:required = true
validators:required:message = "Merci de remplir le champ Consommation"
order=5

Re: Value of numeric fields rounded on New Record

PostPosted: Mon Aug 08, 2011 9:17 am
by shannah
What mysql field types are they? float? decimal?, etc...

I think this issue may be fixed in 1.3rc6. (You can just update the Dataface/Serializer.php file for this fix).

Re: Value of numeric fields rounded on New Record

PostPosted: Mon Aug 08, 2011 11:36 pm
by silma
They are decimal(11,2).

Thanks a lot for you work steve, i'll update now.