use icu_decimal::options::{FixedDecimalFormatterOptions, GroupingStrategy};
#[derive(Debug, Eq, PartialEq, Clone)]
#[non_exhaustive]
pub struct CompactDecimalFormatterOptions {
pub fixed_decimal_formatter_options: FixedDecimalFormatterOptions,
}
impl Default for CompactDecimalFormatterOptions {
fn default() -> Self {
Self {
fixed_decimal_formatter_options: GroupingStrategy::Min2.into(),
}
}
}
impl From<FixedDecimalFormatterOptions> for CompactDecimalFormatterOptions {
fn from(fixed_decimal_formatter_options: FixedDecimalFormatterOptions) -> Self {
Self {
fixed_decimal_formatter_options,
}
}
}
impl From<GroupingStrategy> for CompactDecimalFormatterOptions {
fn from(grouping_strategy: GroupingStrategy) -> Self {
Self {
fixed_decimal_formatter_options: grouping_strategy.into(),
}
}
}