Increase number of decimal places for account entry amounts#18
Open
omarkhan wants to merge 2 commits into
Open
Increase number of decimal places for account entry amounts#18omarkhan wants to merge 2 commits into
omarkhan wants to merge 2 commits into
Conversation
Contributor
|
Yes. Yes, this. 8 decimal places isn't enough. I've been thinking of solving the problem more generally: use an integer field and store the number of places after the decimal field in a currency table. In the mean time, your patch works! |
| account = models.ForeignKey(Account, db_column='accid', related_name='entries') | ||
|
|
||
| amount = models.DecimalField(max_digits=8, decimal_places=2, | ||
| amount = models.DecimalField(max_digits=1000, decimal_places=2, |
Contributor
There was a problem hiding this comment.
What do you think about setting it to 16 instead of 1000? This would make it small enough to fit in a 64bit integer.
(64 bits is enough for a signed 18 digit number, minus 2 decimal places is 16.)
Is that enough?
Contributor
Author
There was a problem hiding this comment.
Sure that's probably enough for most people.
Needed for currencies with high denominations, like Indonesian Rupiah
Contributor
Author
|
I have rebased this on top of master, but I can't seem to run the tests anymore as the settings file has been removed. How do you run the tests now? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Needed for currencies with high denominations, like Indonesian Rupiah. This pull request also adds a missing migration to make account names unique, and makes
urls.pycompatible with django 1.9.