diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 00:47:55 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 00:47:55 +0000 |
commit | 26a029d407be480d791972afb5975cf62c9360a6 (patch) | |
tree | f435a8308119effd964b339f76abb83a57c29483 /intl/icu_capi/js/package/test/data-providers.mjs | |
parent | Initial commit. (diff) | |
download | firefox-26a029d407be480d791972afb5975cf62c9360a6.tar.xz firefox-26a029d407be480d791972afb5975cf62c9360a6.zip |
Adding upstream version 124.0.1.upstream/124.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'intl/icu_capi/js/package/test/data-providers.mjs')
-rw-r--r-- | intl/icu_capi/js/package/test/data-providers.mjs | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/intl/icu_capi/js/package/test/data-providers.mjs b/intl/icu_capi/js/package/test/data-providers.mjs new file mode 100644 index 0000000000..9d1ba68350 --- /dev/null +++ b/intl/icu_capi/js/package/test/data-providers.mjs @@ -0,0 +1,19 @@ +// This file is part of ICU4X. For terms of use, please see the file +// called LICENSE at the top level of the ICU4X source tree +// (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). + +import test from 'ava'; + +import { ICU4XFixedDecimal, ICU4XLocale, ICU4XDataProvider, ICU4XFixedDecimalFormatter } from "../index.js" + +test("use create_compiled to format a simple decimal", async t => { + const locale = ICU4XLocale.create_from_string("bn"); + const provider = ICU4XDataProvider.create_compiled(); + + const format = ICU4XFixedDecimalFormatter.create_with_grouping_strategy(provider, locale, "Auto"); + + const decimal = ICU4XFixedDecimal.create_from_i32(1234); + decimal.multiply_pow10(-2); + + t.is(format.format(decimal), "১২.৩৪"); +}); |