Skip to content

Wrong price format when it is loaded by JS file #6362

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

Closed
jibrandlr opened this issue Aug 26, 2016 · 12 comments
Closed

Wrong price format when it is loaded by JS file #6362

jibrandlr opened this issue Aug 26, 2016 · 12 comments
Labels
bug report Component: Translation Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development

Comments

@jibrandlr
Copy link

Preconditions

  1. Magento 2.1.0, PHP 7.0.8

Steps to reproduce

  1. Set the store locale to es_XX
  2. View any product page

Expected result

  1. Price should be diplayed in the right format: 1,599.00

Actual result

  1. Price is displayed in the wrong format: 1.599,00
@sevos1984
Copy link
Contributor

Hi! Why do you think it is wrong? According to standards separators in es_XX locale are opposite to en_XX. See example https://en.wikipedia.org/wiki/Decimal_mark#Examples_of_use

@jibrandlr
Copy link
Author

jibrandlr commented Aug 29, 2016

@sevos1984 I'm from Mexico, we use the decimal dot. You can see that in the first row from that wikipedia table.
For Spain they do use the comma separator.

I'd like to highlight that the issue is only present when price is loaded by JS, anywhere else in the store and backend, the price format is ok.

@sevos1984
Copy link
Contributor

Thanks for clarification, internal ticket created MAGETWO-57833

@sevos1984 sevos1984 added the Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development label Aug 30, 2016
@jibrandlr
Copy link
Author

@sevos1984 Is there a temporary solution for this? If so, could you share it here? I'm sorry to ask here but I haven't found a solution anywhere else.

@sevos1984
Copy link
Contributor

I don't have any but use another locale.

@sevos1984 sevos1984 removed their assignment Sep 6, 2016
@salelsol
Copy link

Hi, for local usage wikipedia is correct, but not for international usage: Use '.' (Unicode 'FULL STOP' (U+002E)) rather than ',' to indicate a decimal point. Avoid using these symbols as a readability separator. In this case how can I change price just for product detail page: 1,599.00 € ?

@fazilpm
Copy link

fazilpm commented Oct 5, 2016

any update on this issue.? i can able to change in product view page . but still i am not able to change in product details page. ?can any tell me where to change .?

@jibrandlr
Copy link
Author

@fazilpm I think there is not a solution yet. However, you can solve it by using the United States locale and name your translation file en_US.csv

@fazilpm
Copy link

fazilpm commented Oct 5, 2016

@lgarridoj can you please tell me where is the location of the file en_US.csv

@jibrandlr
Copy link
Author

@fazilpm you have to create it and configure Magento to use that locale. You can find all information about translation in the official magento documentation website

@ricardowong
Copy link

ricardowong commented Jun 16, 2017

Although this is not a correct solution you can override vendor/magento/framework/Locale/Format.php to fix the currency format to your choosing, after $groupSymbol definition (around line 124), localeCode should be the target locale.

// MODIFICATION TO CORE FILE, TO FIX ISSUE WITH CURRENCY FORMAT
if($localeCode == 'es_MX'){
$decimalSymbol = '.';
$groupSymbol = ',';
}

@magento-engcom-team magento-engcom-team added 2.1.x Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development bug report Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Component: Translation labels Sep 11, 2017
@magento-engcom-team magento-engcom-team added the Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed label Oct 10, 2017
@magento-engcom-team
Copy link
Contributor

@lgarridoj, thank you for your report.
The issue is already fixed in develop branch, 2.2.0

magento-engcom-team pushed a commit that referenced this issue Nov 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug report Component: Translation Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development
Projects
None yet
Development

No branches or pull requests

7 participants