Comments (6)
It is a valid output for both ru
and ru-RU
locales. Comma is used as a decimal separator and currency code is properly placed as a suffix.
I've also verified that with the Unicode CLDR database. Javascript behaves the same:
console.log((11.49).toLocaleString("ru", {style: "currency", currency: "USD"}))
// "11,49 $"
from django-prices.
It is a valid output for both ru and ru-RU locales. Comma is used as a decimal separator and currency code is properly placed as a suffix.
Sorry, yes, both versions are valid for Russian. But $ as prefix is more common for prices in e-commerce.
Introducing optional LC_NUMERIC
env will give a chance to use different LANGUAGE and NUMERIC locale for such cases (Babel already uses it in format_currency() method).
from django-prices.
Wouldn't using LC_NUMERIC override the format for all languages? There are systems where that variable is exported by the OS which would force the user to explicitly override it which I'm sure would result in bugs being filed against Saleor. What about the decimal point character being different?
from django-prices.
Wouldn't using LC_NUMERIC override the format for all languages? There are systems where that variable is exported by the OS which would force the user to explicitly override it which I'm sure would result in bugs being filed against Saleor.
You're right. If LC_NUMERIC
will be exported by the OS - it'll break multi-language currency localization setup.
What about the decimal point character being different?
Using dot as decimal separator for USD prices in Russian is OK and even more common. Everyone is used to see USD prices in English formatting in e-commerce.
Comma as separator and suffix notation is more common for rubles prices: 10,000 RUB.
So, there is no easy solution to include in core.
It's better for me to override "amount" filter implementing my custom logic there (maybe via dict in settings which will override numeric locale for some languages). Now I realize that this feature is redundant for core functionality.
Sorry for erroneous report
from django-prices.
What if there was a way to override certain settings on a per-locale setting? For example to say that you want to use ¤ #,##0.00
for US dollars in Russian.
from django-prices.
What if there was a way to override certain settings on a per-locale setting? For example to say that you want to use ¤ #,##0.00 for US dollars in Russian.
It will be great feature and it'll completely resolve the problem
from django-prices.
Related Issues (20)
- Support for Django 5
- Taxes are not being saved HOT 1
- BabelDjango not compatible with Django 1.10+
- AmountField value not displaying in admin form Field HOT 2
- Write tests involving models with TaxedMoneyField and save()/delete() calls
- TaxedMoneyField should be Django Field type HOT 3
- Decimal and int can be saved to MoneyFields
- Problem rendering number value on a form HOT 2
- Support For DRF?? HOT 2
- Django 2.2 'TaxedMoneyField' object has no attribute 'unique'
- Introduce snapshottests
- Enhance data fields in `format_price`
- Currency validation enhancements in multiwidget
- Integration tests with views
- Passing a widget instance to MoneyField produce crash HOT 1
- Cannot deserialize MoneyField HOT 1
- Add a long description to setup.py
- Updated_fields on MoneyField not working
- Update to django 4.0?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from django-prices.