QueryBuilder -> NumberConstraint for Money
Hi,
I am storing an amount in cents in the database as integer in field 'gross'. And I am converting cents to dollars using casting:
So, 100 dollars are saved in the database as 10000 (cents). Now, I want to make a NumberConstraint so the user can filter this integer field 'gross' by providing dollars (NOT cents). Input '100' should be converted to '10000' so the correct rows are filtered from the database. How do I do this??? Thanks for your help.
3 Replies
create a custom filter
Thanks, but I am using the QueryBuilder and want to make a Contraint. How do I do this?