Closed PetrDlouhy closed 6 years ago
Hey @PetrDlouhy, thank you for another PR! You raise a very good point here, I think this is something Hordak definitely needs to support.
My thoughts are:
decimal_places=2
max_digits
, docs). This is particularly relevant for currencies such as YEN/WON which have larger values.decimal_places=3
I believe the currency will always render as 1.000
, rather than 1.00
. I think it is ok for Hordak to do this, as Hordak aims to provide core functionality rather than have opinions on rendering. I wanted to flag it here regardless though.I therefore suggest:
HORDAK_MAX_DIGITS
settings, defaulting to the current value of 13
. The docs probably need to note that this includes the digits to the right of the decimal point, not just the left.Let me know if you don't have the time or inclination to do any of these and I'll be happy to take a look!
@adamcharnock Everything done. Please review.
Amazing, that was super-fast, thank you very much! 👍I'm going to merge now. I'll make a couple of tweaks myself then do a release.
Hey @PetrDlouhy,
Just to update you on what I've done:
Looking at the code I realised that I had been ignoring the hordak.defaults
module for a while, so I've moved the settings (and their associated defaults) into there. I've also updated the wording in the docs re the new settings. I hope that is ok with you.
I've also applied the black code formatter, so there have been some extensive but superficial changes there too. Probably worth pulling soon.
If it looks ok to you I'll do a release shortly.
Again, thank you very much for the pull request!
@adamcharnock Everything is OK with me. Only, maybe it would be nice to, mention the MIGRATION_MODULES setting, which could be helpful in case of generating own migration.
Done! Version 1.8.1
released 👍
I would like to set more decimal places in my project (because we want to transfer very little amounts of money). This adds possibility to set that in settings. Problem of my approach is, that user will need to set that before migrating (or create his own migration after setting that).
@adamcharnock What do you think about this? Do you see any better way? If not, I will write some note about this to docs before you merge it.