Struct claude::Prefix [] [src]

pub struct Prefix<'a> { /* fields omitted */ }

Implements Display with the currency symbol at the front.

Methods from Deref<Target = Currency>

Returns an object that implements Display for different methods of printing currency.

Returns an object that implements Display for different methods of printing currency.

Returns the inner value

Returns the inner symbol

Trait Implementations

impl<'a> Deref for Prefix<'a>
[src]

The resulting type after dereferencing

The method called to dereference a value

impl<'a> Display for Prefix<'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: Some('$'), value: 1210}.prefix().to_string() == "$12.10");
assert!(Currency{ symbol: None, value: 1210}.prefix().to_string() == "12.10");

println!("{}", Currency{ symbol: Some('$'), value: 100099}.prefix());

The last line prints the following: text "$1000.99"

Formats the value using the given formatter. Read more