Struct claude::Postfix
[−]
[src]
pub struct Postfix<'a> { /* fields omitted */ }
Implements Display
with the currency symbol at the end.
Methods from Deref<Target = Currency>
fn postfix(&self) -> Postfix
Returns an object that implements Display
for different methods of printing currency.
fn prefix(&self) -> Prefix
Returns an object that implements Display
for different methods of printing currency.
fn as_float(&self) -> f64
Returns the value as float
Warning, do not use this for calculation, this is for displaying only!
fn value(&self) -> i64
Returns the inner value
Trait Implementations
impl<'a> Deref for Postfix<'a>
[src]
type Target = Currency
The resulting type after dereferencing
fn deref(&self) -> &Currency
The method called to dereference a 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(None, 1210).postfix().to_string() == "12,10"); println!("{}", Currency(Some('€'), 100099).postfix());
The last line prints the following:
text "1000,99€"