I have a property that is of type currency, which can have up to four decimals, which is also mapped to four decimals and when saving it is only two decimals.
I'm using delphi Seattle, PostgreSQL version 10, aurelius version 5.11, FireDac.
with firebird and sqlite databases worked, recorded with four decimals
Are you able to save 4 decimais directly using FireDAC? Aurelius doesn't do much here, only sets the parameter value, "saving" the value to database is up to FireDAC.
not. the detail is that you have to choose AsBCD when you want to work with 4 decimals. then I think Aurelius should do this is already parameterized in the Column
if it is ft Currency save only with 2 decimals. that's why there is ftBCD to save with 4 decimals. Is it not possible to make this change with the Column's Scale information?
with the Double type saves with more than 2 decimals, but I'll have to guarantee the limit of 4 decimals in the backend so I don't have problems in mathematical operations and comparisons. it would be better for aurelius to differentiate the type when it has more than 2 decimals.
The limit of 4 decimals is provided by your database type, isn't it?
In any case, you can have the field as double in your class, but still use getter/setter to make sure the value has only 4 decimals.
the limitation of 4 decimals is a design definition. yes I could use the get and set of the property, but it would only work in pascal code because xdata directly fills in the field what type would be double