/* * Copyright (c) 2021-2024, Tim Flynn * * SPDX-License-Identifier: BSD-2-Clause */ #pragma once #include #include #include #include #include #include #include namespace Unicode { enum class NumberFormatStyle { Decimal, Percent, Currency, Unit, }; NumberFormatStyle number_format_style_from_string(StringView); StringView number_format_style_to_string(NumberFormatStyle); enum class SignDisplay { Auto, Never, Always, ExceptZero, Negative, }; SignDisplay sign_display_from_string(StringView); StringView sign_display_to_string(SignDisplay); enum class Notation { Standard, Scientific, Engineering, Compact, }; Notation notation_from_string(StringView); StringView notation_to_string(Notation); enum class CompactDisplay { Short, Long, }; CompactDisplay compact_display_from_string(StringView); StringView compact_display_to_string(CompactDisplay); enum class Grouping { Always, Auto, Min2, False, }; Grouping grouping_from_string(StringView); StringView grouping_to_string(Grouping); enum class CurrencyDisplay { Code, Symbol, NarrowSymbol, Name, }; CurrencyDisplay currency_display_from_string(StringView); StringView currency_display_to_string(CurrencyDisplay); enum class CurrencySign { Standard, Accounting, }; CurrencySign currency_sign_from_string(StringView); StringView currency_sign_to_string(CurrencySign); struct DisplayOptions { NumberFormatStyle style { NumberFormatStyle::Decimal }; SignDisplay sign_display { SignDisplay::Auto }; Notation notation { Notation::Standard }; Optional compact_display; Grouping grouping { Grouping::Always }; Optional currency; Optional currency_display; Optional currency_sign; Optional unit; Optional