SPECIFICATION
In Shop Parameter > General, we need to remove Number of decimals input.
WHY
Since the CDLR handle every currency decimal, a general decimal parameter doesn't make sense.
FAILING CASE
Need to study if there will be a technical impact.
Next step after the PR #10455
Furthermore, this parameter currently doesn't work
@marionf @MatShir
i've seen this parameter in some modules including ones for integration with third party ERP etc. but it was on 1.6, if this options is not working in 1.7 in my opinion it's safe to remove it
having fallback from CLDR when we're getting Configuration::get('price_display_precision') could be tricky
@colinegin @marionf
From what I see in the code, the "decimal" value that is set in the back office is used at several places in the code...
Should I use a default decimal value everywhere, would that be 0 ? Or should I use the CLDR ?
As seen with @MatShir , I'll list all the places where the decimal prevision value from the back office is used, and write it in this issue.
From there the technical impact will be clearer.
@colinegin @marionf @eternoendless
From what I've seen in the code, the number of decimals given by a user in the back office is used not only for display values in the backend, but also for calculations, as a computing value, determining the level of precision in basket calculations for example.
I explained the issue to @eternoendless , and here's a solution that I could implement:
1/ We do not remove the possibility to specify a decimal prevision value, maybe only reword it, saying that it will be used only for calculations.
2/ For display values, we should use the standard number of decimals for a given currency, according to the CLDR.
3/ The decimal precision value given by the user in the back office will keep being used for calculations.
Let's go with your recommendation @matthieu-rolland, it will be safer !
I ping @LouiseBonnard which will be in charge of the rewording.
As for your point 2, just note that with the new feature in the currency page, it will be possible to override the CLDR rules.
Thanks !
Is there a use case for "I want my cart calculations to be less precise than as much as possible"? --> If not, then I suggest we drop this option altogether.
That does make sense... I didn't think about it this way, but why would someone want to make his calculations less precise, what is the added benefit?
@marionf and @samuel-pires do you think we should do what @eternoendless suggests?
Basically we would drop the feature and the rules would be:
Display price precision: use the CLDR standard for the given currency.
Calculation price precision: use a default precision value (for example 6 digits precision)
I agree it makes sense to me to drop it.
Though what are the possible impacts of using 6 decimals for calculations vs 2 (I guess most users used to let 2 decimals in this field)?
@marionf do you see a case where it could be needed?
Using more decimal positions leads to more precise calculations.
Like that, I do not see any case where the calculations would have to be less precise :thinking:
Alright, then let's do it @matthieu-rolland 馃憤
ok !
I will do that then. Thank you everyone for your input
In PS 1.7.6 I can change the number of decimals. However, Switzerland is using a decimal point and not a comma. How can I change the comma to a point?
Most helpful comment
Let's go with your recommendation @matthieu-rolland, it will be safer !
I ping @LouiseBonnard which will be in charge of the rewording.
As for your point 2, just note that with the new feature in the currency page, it will be possible to override the CLDR rules.
Thanks !