![]() Maybe next month we're taking in crypto and we need to support 7 decimal places. Excel + Python + Pandas (for example) does some funky things with numbers that you might not notice until it's too late. It's often wise to round numbers going into the database to something sensible, like 4dp, 8dp, even 10dp to avoid things like 0.999999999998 being the in-code representation of 1.0. But that doesn't mean you have to pollute the database. Sure, if you're a developer you're going to have some nasty choices, like having to work with floating point numbers because your crappy language doesn't support exact numeric types. Storing data in a format that isn't human readable leads to mistakes being made, "I didn't realise the number was hundredths of a cent I assumed it was in dollars - oops!".You're honestly not going to notice the performance difference unless you have billions of rows of data and you're performing lots of really complicated calculations. ![]() These integer/ bigint solutions sound great on paper, but then they fall down when you need to store fractional units. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |