New issue
Advanced search Search tips

Issue 724150 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: May 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 3
Type: Bug



Sign in to add a comment

PaymentRequest should format currency as "AUD $5.00" regardless of device location

Project Member Reported by rouslan@chromium.org, May 18 2017

Issue description

Chrome Version       : 60.0.3100.0

What steps will reproduce the problem?
1. Call `new PaymentRequest([{supportedMethods: ['basic-card']}], {total: {label: 'Tots', amount: {currency: 'AUD', value: '5.00'}}}).show();`

What is the expected result?
Currency should be formatted "AUD $5.00".

What happens instead of that?
Currency is formated as "AUD A$5.00".

Please provide any additional information below. Attach a screenshot if
possible.

UserAgentString: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3100.0 Safari/537.36

Need to strip the longest matching prefix of the currency code (AUD) from the currency symbol (A$).
 

Comment 2 by ma...@chromium.org, May 18 2017

Status: Started (was: Assigned)
Thanks, you're right!
Project Member

Comment 3 by bugdroid1@chromium.org, May 18 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/fb2b1a4cf89b8912e9a0dc7e718ccef161d4fce4

commit fb2b1a4cf89b8912e9a0dc7e718ccef161d4fce4
Author: Mathieu Perreault <mathp@chromium.org>
Date: Thu May 18 22:45:26 2017

[Currency] Trim the 1-letter version of the currency code

Callers are expected to show the currency code next to the amount, so
strip all variations of the currency code from the output, when
possible.

Bug:  724150 
Test: components_unittests
Change-Id: I4cbe59f710df0375785cf10068b343d00cc2cc29
Reviewed-on: https://chromium-review.googlesource.com/508222
Reviewed-by: Rouslan Solomakhin <rouslan@chromium.org>
Commit-Queue: Mathieu Perreault <mathp@chromium.org>
Cr-Commit-Position: refs/heads/master@{#472958}
[modify] https://crrev.com/fb2b1a4cf89b8912e9a0dc7e718ccef161d4fce4/components/payments/core/currency_formatter.cc
[modify] https://crrev.com/fb2b1a4cf89b8912e9a0dc7e718ccef161d4fce4/components/payments/core/currency_formatter_unittest.cc

Comment 4 by ma...@chromium.org, May 18 2017

Status: Fixed (was: Started)
Components: -UI>Browser>Autofill>Payments UI>Browser>Payments

Sign in to add a comment