You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using Craft/Craft Commerce headless. All Commerce pricing values that feature the currency format the currency and value the same. e.g. storedTotalPriceAsCurrency returns "CHF 100.00" – so currency, space, value. An issue arises with negative values, probably most commonly used in the discount values, e.g. storedTotalDiscountAsCurrency, which returns CHF-100.00, so currency, NO space, value.
Steps to reproduce
Use Commerce in a headless project (don't know if regular usage also has this problem)
Use a negative pricing value in any …AsCurrency property (e.g. storedTotalDiscountAsCurrency)
Expected behavior
Negative values are returned the same as positive values, meaning currency – space – value.
Example positive value: CHF 100.00
Example negative value: CHF -100.00
Actual behavior
Negative values are formatted differently than positive values.
Example positive value: CHF 100.00 (with space, correct way)
Example negative value: CHF-100.00 (no space, wrong way)
Craft CMS version
Craft Pro 5.5.0
Craft Commerce version
5.2.6
PHP version
8.2.20
Operating system and version
No response
Database type and version
No response
Image driver and version
No response
Installed plugins and versions
The text was updated successfully, but these errors were encountered:
Hey @nfourtythree – I'm using de-CH (German in Switzerland). The correct way here it would be CHF -123.45. This change should affect all in Craft available locales from Switzerland (de-CH, fr-CH, it-CH, en-CH).
What happened?
Description
I am using Craft/Craft Commerce headless. All Commerce pricing values that feature the currency format the currency and value the same. e.g.
storedTotalPriceAsCurrency
returns"CHF 100.00"
– so currency, space, value. An issue arises with negative values, probably most commonly used in the discount values, e.g.storedTotalDiscountAsCurrency
, which returnsCHF-100.00
, so currency, NO space, value.Steps to reproduce
Expected behavior
Negative values are returned the same as positive values, meaning currency – space – value.
Example positive value: CHF 100.00
Example negative value: CHF -100.00
Actual behavior
Negative values are formatted differently than positive values.
Example positive value: CHF 100.00 (with space, correct way)
Example negative value: CHF-100.00 (no space, wrong way)
Craft CMS version
Craft Pro 5.5.0
Craft Commerce version
5.2.6
PHP version
8.2.20
Operating system and version
No response
Database type and version
No response
Image driver and version
No response
Installed plugins and versions
The text was updated successfully, but these errors were encountered: