Struct claude::Postfix
[−]
[src]
pub struct Postfix<'a> { /* fields omitted */ }Implements Display with the currency symbol at the end.
Methods from Deref<Target = Currency>
pub fn postfix(&self) -> Postfix[src]
Returns an object that implements Display for different methods of printing currency.
pub fn prefix(&self) -> Prefix[src]
Returns an object that implements Display for different methods of printing currency.
pub fn as_float(&self) -> f64[src]
Returns the value as float
Warning, do not use this for calculation, this is for displaying only!
pub fn value(&self) -> i64[src]
Returns the inner value
pub fn symbol(&self) -> Option<Symbol>[src]
Returns the inner symbol
Trait Implementations
impl<'a> Deref for Postfix<'a>[src]
type Target = Currency
The resulting type after dereferencing.
fn deref(&self) -> &Currency[src]
Dereferences the value.
impl<'a> Display for Postfix<'a>[src]
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€"