-
Notifications
You must be signed in to change notification settings - Fork 649
Closed
Description
Right now it's assumed that trailing zeros should be removed upon a call to Value, as a decimal is being serialized into the database. This doesn't take into account cases where you want to keep the number of decimal places consistent across the board. For example, if I created a Decimal via:
dec, _ := decimal.NewFromString("100.00")
I would expect it to enter the database as "100.00". When in actuality, the trailing zeros are removed and "100" is saved. This creates some interesting scenarios when storing and retrieving decimals from the database. I would expect the precedent to be that decimals are represented as a string in exactly the same way they were created, unless the user does an operation that would change the precision(such as using StringFixed).
Metadata
Metadata
Assignees
Labels
No labels