Basic currency and number formatting library.
Installation
- Add the following lines to your
Cargo.toml
[]
= "0.1.1"
- Use it in your crate:
extern crate Lotus;
use *;
Usage
Here are some examples which illustrate the library functionality. Please read the documentation as well.
extern crate Lotus;
use *;
// Builder format (recommended)
let rupee = default
.symbol
.precision
.format_positive
.format_negative
.format_zero
.decimal_str
.thousand_str
.build
.unwrap;
assert_eq!;
assert_eq!;
assert_eq!;
// Using Lotus::new()
let dollar = new; // Lotus::new(symbol, precision)
assert_eq!;
// Using lotus! macro
let f = lotus!; // lotus!(number, symbol)
assert_eq!;
let g = lotus!; // lotus!(number)
assert_eq!;