Currency normalization
See original GitHub issueIn my project I need to format currency so that it won’t display digital decimals if they are equal to zero. Right now I’m doing it by replacing .00 to .## in current locale pattern and passing it as format to format_currency and setting currency_digits=False. It works like charm when price has 0 or 2 decimal digits, but I’m not sure how to handle prices with 3 decimal digits. Can I safely replace .00 with . + '#' * decimal_digits or it will cause problems I’m not aware of? Or maybe there is better solution for that?
Issue Analytics
- State:
- Created 7 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Types of Data Normalization
Mercer WIN provides for two types of data normalization: Scaling and Currency Conversion. Scaling. Allows you to define the format in which market...
Read more >Currency Normalizer - PostHog
Currency Normalizer. Simplify your data by normalizing multiple currencies in PostHog events into a single currency of your choice.
Read more >What Is Monetary Policy Normalization? | St. Louis Fed
Transform the Fed's asset holdings to a composition similar to those of pre-Great Recession times. This transformation will involve a reduction in the...
Read more >Policy Normalization - Federal Reserve Board
The Committee views changes in the target range for the federal funds rate as its primary means of adjusting the stance of monetary...
Read more >Normalizing Monetary Policy | Cato Institute
The current focus of Federal Reserve policy is on “normalization” of monetary policy—that is, on increasing short‐term interest rates and shrinking the ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Am I understanding this correctly:
If so, you can adapt the innards of
format_currency(though I admit being able to wholesale override the number of decimals would be handy):outputs
Bumping this – I have a use case where I sometimes want to display currency without any decimals, but not have a solution that requires a different format string for each locale.