From 78e63d52ff6c97463ee512c24b16488e0d4c4ac2 Mon Sep 17 00:00:00 2001 From: Manish Goregaokar Date: Wed, 4 Aug 2021 13:45:13 -0700 Subject: [PATCH] Add new_from_data for FixedDecimalFormat --- components/decimal/src/lib.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/components/decimal/src/lib.rs b/components/decimal/src/lib.rs index 4c5acc56d7b..f408334582a 100644 --- a/components/decimal/src/lib.rs +++ b/components/decimal/src/lib.rs @@ -114,6 +114,16 @@ impl<'data> FixedDecimalFormat<'data> { Ok(Self { options, symbols }) } + pub fn new_from_data( + data: DataPayload<'data, provider::DecimalSymbolsV1Marker>, + options: options::FixedDecimalFormatOptions, + ) -> Self { + Self { + options, + symbols: data, + } + } + /// Formats a [`FixedDecimal`], returning a [`FormattedFixedDecimal`]. pub fn format<'l>(&'l self, value: &'l FixedDecimal) -> FormattedFixedDecimal<'l> { FormattedFixedDecimal {