//! Example showing how to localize fixed_decimal decimals
usefixed_decimal::Decimal;useicu_locale::{Locale, locale};usel10n_embed::Localize;constDEFAULT_LOCALE: Locale =locale!("en-US");fnmain()->Result<(), fixed_decimal::LimitError>{// Create some decimals
let zero:i32=0;let five_million:u64=5_000_000;let zero_point_two:f64=0.2;letmut negative_two_point_five =Decimal::from(-25);
negative_two_point_five.multiply_pow10(-1);// Localize those decimals into a human-readable number
println!("Zero: {}", zero.localize_for(&DEFAULT_LOCALE));println!("Five million: {}",
five_million.localize_for(&DEFAULT_LOCALE));println!("Zero point two: {}",
zero_point_two.localize_for(&DEFAULT_LOCALE));println!("Negative two point five: {}",
negative_two_point_five.localize_for(&DEFAULT_LOCALE));Ok(())}