| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "components/payments/currency_formatter.h" | 5 #include "components/payments/core/currency_formatter.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include "base/logging.h" |
| 8 | |
| 9 #include "base/numerics/safe_conversions.h" | 8 #include "base/numerics/safe_conversions.h" |
| 10 #include "base/strings/string_util.h" | 9 #include "base/strings/string_util.h" |
| 11 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
| 12 #include "third_party/icu/source/common/unicode/stringpiece.h" | 11 #include "third_party/icu/source/common/unicode/stringpiece.h" |
| 13 #include "third_party/icu/source/common/unicode/uchar.h" | 12 #include "third_party/icu/source/common/unicode/uchar.h" |
| 14 #include "third_party/icu/source/common/unicode/unistr.h" | |
| 15 #include "third_party/icu/source/common/unicode/utypes.h" | 13 #include "third_party/icu/source/common/unicode/utypes.h" |
| 16 | 14 |
| 17 namespace payments { | 15 namespace payments { |
| 18 | 16 |
| 19 const char kIso4217CurrencySystem[] = "urn:iso:std:iso:4217"; | 17 const char kIso4217CurrencySystem[] = "urn:iso:std:iso:4217"; |
| 20 | 18 |
| 21 namespace { | 19 namespace { |
| 22 | 20 |
| 23 // Support a maximum of 10 fractional digits, similar to the ISO20022 standard. | 21 // Support a maximum of 10 fractional digits, similar to the ISO20022 standard. |
| 24 // https://www.iso20022.org/standardsrepository/public/wqt/Description/mx/dico/ | 22 // https://www.iso20022.org/standardsrepository/public/wqt/Description/mx/dico/ |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 if (u_isUWhiteSpace(output[output.length() - 1])) { | 124 if (u_isUWhiteSpace(output[output.length() - 1])) { |
| 127 output.remove(output.length() - 1, 1); | 125 output.remove(output.length() - 1, 1); |
| 128 } | 126 } |
| 129 | 127 |
| 130 std::string output_str; | 128 std::string output_str; |
| 131 output.toUTF8String(output_str); | 129 output.toUTF8String(output_str); |
| 132 return base::UTF8ToUTF16(output_str); | 130 return base::UTF8ToUTF16(output_str); |
| 133 } | 131 } |
| 134 | 132 |
| 135 } // namespace payments | 133 } // namespace payments |
| OLD | NEW |