As per recommendations, I always use the
numeric type for any column supposed to hold a sum of money.
When inserting such values (or updating them), I always use high precision math functions in my application (PHP "BC Math").
This results in the fields getting values such as:
I view them later in pgAdmin 4 and it's very annoying to see the long series of pointless zeroes, when it should be just:
There is no meaning with storing/representing all those zeroes like that. I'm not fully sure if this is PG or pgAdmin's doing, actually.
Either way, I want to avoid it. How do I prevent numeric values from being stored with pointless zeroes?
(Of course, I don't want less precision -- I'm just talking about zeroes that literally have no meaning and thus should be automatically cut off from the right until they hit a non-zero digit.)
Is PG for some reason storing these numeric numbers like this? If so, why?