Rethink the commerce.price method #2579
Labels
breaking change
Cannot be merged when next version is not a major release
c: bug
Something isn't working
c: refactor
PR that affects the runtime behavior, but doesn't add new features or fixes bugs
m: commerce
Something is referring to the commerce module
p: 1-normal
Nothing urgent
Milestone
Currently the price method generates prices like this
"$5.39"
. This has several drawbacks, as some currency symbols are written behind the price instead of in front. Some might want an extra space...There is also the thing about the prices, that require fine tuning of the dec parameter depending on the generated value.
e.g.
Prices are also very often used as numbers e.g. if they are combined with quantities:
So commerce.price() should return
number
.Summary
commerce.price()
should returnnumber
.dec
parameter should be determined automatically (unless set specifically)symbol
parameter should be removed#See also
The text was updated successfully, but these errors were encountered: