pub struct Postfix<'a> { /* private fields */ }Expand description
Implements Display with the currency symbol at the end.
Methods from Deref<Target = Currency>§
Sourcepub fn postfix(&self) -> Postfix<'_>
pub fn postfix(&self) -> Postfix<'_>
Returns an object that implements Display for different methods of printing currency.
Examples found in repository?
More examples
Sourcepub fn prefix(&self) -> Prefix<'_>
pub fn prefix(&self) -> Prefix<'_>
Returns an object that implements Display for different methods of printing currency.
Examples found in repository?
More examples
Trait Implementations§
Source§impl<'a> Display for Postfix<'a>
Allows Currencies to be displayed as Strings.
The format includes no comma delimiting with a two digit precision decimal.
impl<'a> Display for Postfix<'a>
Allows Currencies to be displayed as Strings. The format includes no comma delimiting with a two digit precision decimal.
§Examples
use claude::Currency;
assert!(Currency{ symbol: None, value: 1210}.postfix().to_string() == "12,10");
println!("{}", Currency{ symbol: Some('€'), value: 100099}.postfix());The last line prints the following:
"1000,99€"Auto Trait Implementations§
impl<'a> Freeze for Postfix<'a>
impl<'a> RefUnwindSafe for Postfix<'a>
impl<'a> Send for Postfix<'a>
impl<'a> Sync for Postfix<'a>
impl<'a> Unpin for Postfix<'a>
impl<'a> UnwindSafe for Postfix<'a>
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