Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Numberformatter intl bugs with negative numbers #1014

Merged

Conversation

mykehsd
Copy link
Contributor

@mykehsd mykehsd commented Feb 7, 2014

Testing must take place in the en_US locale AND our number formatter must change the pattern

This solve the behat failures for checking promotional discounts (most locales
show negative number as: -$100.00. There is no dependable locale across different versions of pecl-intl that display negative currencies the same.

Fixes #853 along with other issues.

@@ -30,6 +30,10 @@ public function __construct(CurrencyContextInterface $currencyContext, CurrencyC
$this->currencyContext = $currencyContext;
$this->converter = $converter;
$this->formatter = new \NumberFormatter($locale ?: \Locale::getDefault(), \NumberFormatter::CURRENCY);

$sMyPattern = "¤#,##0.00;-¤#,##0.00";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be just $pattern.

…or it.

This solve the behat failures for checking promotional discounts (most locales
show negative number as: -$100.00,  en-US shows ($100.00)
Fixes Sylius#853 along with other issues.
@mykehsd
Copy link
Contributor Author

mykehsd commented Feb 17, 2014

@pjedrzejewski Fixed. Thanks!

pjedrzejewski pushed a commit that referenced this pull request Feb 17, 2014
…sting

Numberformatter intl bugs with negative numbers
@pjedrzejewski pjedrzejewski merged commit b262d85 into Sylius:master Feb 17, 2014
@pjedrzejewski
Copy link
Member

Thank you Myke! 👍

pamil pushed a commit to pamil/Sylius that referenced this pull request May 7, 2019
…tterTesting

Numberformatter intl bugs with negative numbers
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Behat tests fail because of NumberFormatter
2 participants