How do you store price and time data in your database to avoid rounding errors and preserve accuracy:
For prices, I use centicents (so $123.4501 becomes 1234501).
For time, I currently donât keep greater accuracy than second, so I just store 11/10/2011 10:01:31 as a string (â20111011â) and an integer (â100131â).
What do you do?
Anyone storing sub second time? Do you store the sub second bit with the super second bit? Or have a separate column for this?
For prices, I use centicents (so $123.4501 becomes 1234501).
For time, I currently donât keep greater accuracy than second, so I just store 11/10/2011 10:01:31 as a string (â20111011â) and an integer (â100131â).
What do you do?
Anyone storing sub second time? Do you store the sub second bit with the super second bit? Or have a separate column for this?