-#![allow(dead_code)]
use std::{
fmt::{Display, Formatter, Result as FmtResult},
ops::RangeInclusive,
}
pub struct Settings {
- epoch: Option<i32>,
+ pub epoch: Option<i32>,
/// Either `'.'` or `','`.
- decimal: char,
+ pub decimal: char,
/// Format `F`, `E`, `COMMA`, and `DOT` with leading zero (e.g. `0.5`
/// instead of `.5`)?
- include_leading_zero: bool,
+ pub include_leading_zero: bool,
/// Custom currency styles.
- ccs: EnumMap<CC, Option<NumberStyle>>,
+ pub ccs: EnumMap<CC, Option<NumberStyle>>,
}
impl Default for Settings {
/// A numeric output style. This can express numeric formats in
/// [Category::Basic] and [Category::Custom].
pub struct NumberStyle {
- neg_prefix: Affix,
- prefix: Affix,
- suffix: Affix,
- neg_suffix: Affix,
+ pub neg_prefix: Affix,
+ pub prefix: Affix,
+ pub suffix: Affix,
+ pub neg_suffix: Affix,
/// Decimal point: `'.'` or `','`.
- decimal: char,
+ pub decimal: char,
/// Grouping character: `'.'` or `','` or `None`.
- grouping: Option<char>,
+ pub grouping: Option<char>,
/// Format as `.5` or `0.5`?
- include_leading_zero: bool,
+ pub include_leading_zero: bool,
/// An `Affix` may require more bytes than its display width; for example,
/// U+00A5 (¥) is 2 bytes in UTF-8 but occupies only one display column.
/// can be used to size memory allocations: for example, the formatted
/// result of `CCA20.5` requires no more than `(20 + extra_bytes)` bytes in
/// UTF-8.
- extra_bytes: usize,
+ pub extra_bytes: usize,
}
pub struct Affix {
/// String contents of affix.
- s: String,
+ pub s: String,
/// Display width in columns (see [unicode_width])
- width: usize,
+ pub width: usize,
}