pub enum AmountFormat {
Plain,
USComma,
EUFormat,
SpaceSeparator,
CurrencyPrefix(String),
CurrencySuffix(String),
Accounting,
Scientific,
NoDecimals,
FourDecimals,
}Expand description
Amount format variations.
Variants§
Plain
Plain number: 1234.56
USComma
With thousand separator (comma): 1,234.56
EUFormat
European (dot thousand, comma decimal): 1.234,56
SpaceSeparator
Space thousand separator: 1 234.56
CurrencyPrefix(String)
With currency prefix: $1,234.56
CurrencySuffix(String)
With currency suffix: 1,234.56 USD
Accounting
Accounting format (parentheses for negative): (1,234.56)
Scientific
Scientific notation: 1.23456E+03
NoDecimals
No decimal places: 1235
FourDecimals
Four decimal places: 1234.5600
Implementations§
Source§impl AmountFormat
impl AmountFormat
Sourcepub fn from_locale(
decimal_sep: &str,
thousands_sep: &str,
currency_symbol: &str,
_default_currency: &str,
) -> Self
pub fn from_locale( decimal_sep: &str, thousands_sep: &str, currency_symbol: &str, _default_currency: &str, ) -> Self
Infer the baseline AmountFormat from a country pack’s locale settings.
Uses the decimal_separator, thousands_separator, currency_symbol,
and default_currency to pick the most appropriate “correct” format.
Trait Implementations§
Source§impl Clone for AmountFormat
impl Clone for AmountFormat
Source§fn clone(&self) -> AmountFormat
fn clone(&self) -> AmountFormat
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for AmountFormat
impl Debug for AmountFormat
Source§impl PartialEq for AmountFormat
impl PartialEq for AmountFormat
impl StructuralPartialEq for AmountFormat
Auto Trait Implementations§
impl Freeze for AmountFormat
impl RefUnwindSafe for AmountFormat
impl Send for AmountFormat
impl Sync for AmountFormat
impl Unpin for AmountFormat
impl UnsafeUnpin for AmountFormat
impl UnwindSafe for AmountFormat
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