chromium/components/payments/core/currency_formatter.cc

// Copyright 2017 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "components/payments/core/currency_formatter.h"

#include <memory>
#include <string_view>

#include "base/logging.h"
#include "base/numerics/safe_conversions.h"
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
#include "third_party/icu/source/common/unicode/stringpiece.h"
#include "third_party/icu/source/common/unicode/uchar.h"
#include "third_party/icu/source/common/unicode/utypes.h"

namespace payments {

namespace {

// Support a maximum of 10 fractional digits, similar to the ISO20022 standard.
// https://www.iso20022.org/standardsrepository/public/wqt/Description/mx/dico/
//   datatypes/_L8ZcEp0gEeOo48XfssNw8w
const int kMaximumNumFractionalDigits =;

// Max currency code length. Length of currency code can be at most 2048.
const static size_t kMaxCurrencyCodeLength =;

// Currency codes longer than 6 characters get truncated to 5 + ellipsis.
const static size_t kMaxCurrencyCodeDisplayedChars =;

// Used to truncate long currency codes.
const char kEllipsis[] =;

// Returns whether the |currency_code| is valid to be used in ICU.
bool ShouldUseCurrencyCode(const std::string& currency_code) {}

std::string FormatCurrencyCode(const std::string& currency_code) {}

}  // namespace

CurrencyFormatter::CurrencyFormatter(const std::string& currency_code,
                                     const std::string& locale_name)
    :{}

CurrencyFormatter::~CurrencyFormatter() {}

void CurrencyFormatter::SetMaxFractionalDigits(const int maxFractionalDigits) {}

std::u16string CurrencyFormatter::Format(const std::string& amount) {}

}  // namespace payments