Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef COMPONENTS_PAYMENTS_CURRENCY_FORMATTER_H_ | |
| 6 #define COMPONENTS_PAYMENTS_CURRENCY_FORMATTER_H_ | |
| 7 | |
| 8 #include <string> | |
| 9 | |
| 10 #include "third_party/icu/source/common/unicode/locid.h" | |
| 11 | |
| 12 namespace payments { | |
| 13 | |
| 14 // Formats the |amount| according to the |currency_code|, which typically | |
| 15 // adheres to [ISO4217] (for example, "USD" for US Dollars). The result will NOT | |
| 16 // contain the currency code, nor a subset of it. Rather, the caller of this | |
| 17 // function should display the currency code separately. Note that |amount| | |
| 18 // and |currency_code| should have been validated (as part of | |
| 19 // payment_details_validation.h) before this is called, but this function will | |
| 20 // still do light validation, and return |amount| in failure cases. The return | |
| 21 // value may contain non-breaking space. | |
| 22 const std::string FormatAmountForCurrency(const std::string& amount, | |
|
please use gerrit instead
2017/01/11 18:29:30
The "const" keyword here does not seem to server a
Mathieu
2017/01/11 22:22:26
Done.
| |
| 23 const std::string& currency_code, | |
| 24 const icu::Locale& locale); | |
| 25 | |
| 26 } // namespace payments | |
| 27 | |
| 28 #endif // COMPONENTS_PAYMENTS_CURRENCY_FORMATTER_H_ | |
| OLD | NEW |