I have a vision application that will be saving and retrieving currency values from a database.
Normally the best practice is to save your currency in INTEGER columns where a single INT of 1 represents the smallest unit of current, like a single cent.
I’m pondering how to handle this with a numeric text field. When loading the record, I can turn it into a float in my SQL named query, and use the float part of the numeric text field, and when saving it, go from float to INT - but this part I feel might be an issue.
It would be nice if I could strictly work with ints, and the numeric text field formatted it correctly like #.00, despite there being no real decimals.
Any thoughts on how to best handle currency in an integer database column but showing it to users as currency, while at the same time, my scripts are only ever handling INT objects? I only want to handle int types in the rare but bad event a float gets rounded inappropriately.