Skip to main content

label_currency_marks

Function label_currency_marks 

Source
pub fn label_currency_marks(
    prefix: &str,
    suffix: &str,
    big_mark: &str,
    decimal_mark: &str,
    accuracy: Option<f64>,
) -> impl Fn(f64) -> String + Send + Sync
Expand description

label_currency with an explicit decimal mark as well.

use ggplot_rs::scale::format::label_currency_marks;
let eur = label_currency_marks("", " €", ".", ",", Some(0.01));
assert_eq!(eur(-1234.5), "-1.234,50 €");