icu_decimal
Formatting basic decimal numbers.
This module is published as its own crate (icu_decimal
)
and as part of the icu
crate. See the latter for more details on the ICU4X project.
Support for currencies, measurement units, and compact notation is planned. To track progress, follow icu4x#275.
Examples
Format a number with Bangla digits
use FixedDecimal;
use FixedDecimalFormatter;
use locale;
use assert_writeable_eq;
let fdf = try_new
.expect;
let fixed_decimal = from;
assert_writeable_eq!;
Format a number with digits after the decimal separator
use FixedDecimal;
use FixedDecimalFormatter;
use Locale;
use assert_writeable_eq;
let fdf =
try_new
.expect;
let fixed_decimal = from.multiplied_pow10;
assert_writeable_eq!;
Format a number using an alternative numbering system
Numbering systems specified in the -u-nu
subtag will be followed as long as the locale has
symbols for that numbering system.
use FixedDecimal;
use FixedDecimalFormatter;
use locale;
use assert_writeable_eq;
let fdf = try_new
.expect;
let fixed_decimal = from;
assert_writeable_eq!;
More Information
For more information on development, authorship, contributing etc. please visit ICU4X home page
.