Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Ask HN: Financial data and rounding
4 points by nopal on Sept 16, 2009 | hide | past | favorite | 1 comment
I made a proposal to a client on how they should store and work with finaicnal data that has the potential to involve minute fractions of a dollar. (e.g. Pay contractor B 13.31% of the $55.53 billed)

I proposed that they keep financial values in as accurate a form as possible (to the ten-thousandths, because they use the T-SQL smallmoney type), use bankers' rounding and round at the last possible moment.

This proposal was rejected and I was told that they wanted to round to the hundredth, use "round half up" rounding and perform the rounding before any calculations were performed with the financial data.

I feel that their decisions are wrong, but they are adamant and this edict came from their financial department.

Am I worrying too much, or does it seem like this is a large potential problem?



Personally if all of my forecasting, AP and AR are in a hundredths-based system, I'd keep the data stored that way. There will never be a time in which they will cut a check or do forecasting in anything less than hundredths so why worry about storing to the ten-thousandths?

I'm a T-SQL guy myself and many folks do not use SMALLMONEY or MONEY datatypes because they allow thousandths/ten-thousandths. Instead we use DECIMAL so that we can force storage of only hundredths.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: