#[non_exhaustive]pub struct DigitOptions {
pub minimum_integer: u8,
pub fraction: Option<(u8, u8)>,
pub significant: Option<(u8, u8)>,
pub priority: RoundingPriority,
pub increment: u16,
pub mode: RoundingMode,
pub strip_if_integer: bool,
}Expand description
ECMA-402’s digit options as SetNumberFormatDigitOptions resolved them
for MF2 — so never a set Intl rejects: where it would throw, the
numeric function reported Bad Option and dropped or replaced the
option (plans/03-runtime.md §5.3).
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.minimum_integer: u8minimumIntegerDigits, 1–21.
fraction: Option<(u8, u8)>minimumFractionDigits, maximumFractionDigits (0–100); None:
the style’s defaults (a currency’s own digits) or, with
significant and priority Auto, rounding by significant digits
alone.
significant: Option<(u8, u8)>minimumSignificantDigits, maximumSignificantDigits (1–21);
None: rounding by fraction digits alone.
priority: RoundingPriorityroundingPriority (not Auto exactly when both are set).
increment: u16roundingIncrement (1: none).
mode: RoundingModeroundingMode.
strip_if_integer: booltrailingZeroDisplay: "stripIfInteger".
Trait Implementations§
Source§impl Clone for DigitOptions
impl Clone for DigitOptions
impl Copy for DigitOptions
Source§impl Debug for DigitOptions
impl Debug for DigitOptions
impl Eq for DigitOptions
Source§impl Hash for DigitOptions
impl Hash for DigitOptions
Source§impl PartialEq for DigitOptions
impl PartialEq for DigitOptions
impl StructuralPartialEq for DigitOptions
Auto Trait Implementations§
impl Freeze for DigitOptions
impl RefUnwindSafe for DigitOptions
impl Send for DigitOptions
impl Sync for DigitOptions
impl Unpin for DigitOptions
impl UnsafeUnpin for DigitOptions
impl UnwindSafe for DigitOptions
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more