No, no calculation and no converter. We had an end user issue with our solution we could not explain.
This field is part of the threesome calc_price, calc_quantity and calc_unit_price where :
calc_price = calc_unit_price * calc_quantity and
calc_unit_price = calc_price / calc_quantity.
End user is permitted to change both calc_price and calc_unit_price so the famous rounding problem (when rounding on 2 decimals) is nearby.
End user is able to start a rounding action on 2 decimals for a group of (_pwp) records.
Before some kind of output we have a check to ensure all unit prices have no more than 2 decimal digits.
After the rounding action the end user still failed the above check and that’s where our search started which resulted in this post.
It seems imho that Servoy does some kind of rounding check in the foundset.field assignment (Servoy thinks the value of the field has not changed , 4.800000000000001 == 4.8 ).
4.800000000000001 is a value in the javascript and postgres precision domain (16 digits).
var a
a = 4.800000000000001
a == 4.8 returns false
a == 4.800000000000001 returns true
a = 4.8
a == 4.8 returns true
a == 4.800000000000001 returns false
So : same exercise with foundset.field : not ok, with a variable : ok !
Just heard from Servoy that the Servoy (data/foundset ?) maximum precision = 1e-07.
That explains my problem case !
It’s a surprise that the Servoy precision is so much less than the javascript and database maximum precision…
Where can I find that in the Wiki (or in the sales info ) ?
var a
a = 4.800000000000001
a == 4.8 returns false
a == 4.800000000000001 returns true
a = 4.8
a == 4.8 returns true
a == 4.800000000000001 returns false
So : same exercise with foundset.field : not ok, with a variable : ok !
we do that on purpose, because else many floating point nummers are constantly changes because we don’t see them as the same…
because of the rounding it can be constantly a bit changes because of that if you first set:
formvar = 4.8
and then later on
formvar = 4.8000000000000000000001
we do a special equals that just say, that those are the same. Else for example calculations would constantly change there value based on some
Or we get complains that the records go in edit but nothing really changes (visually for a user or even in the db)
So, Servoy is a no go when numeric precision in table data beyond 1e-07 is needed ?
Again, far more precision is available in javascript and database (1e-15).