Skip to content

Commit

Permalink
Return Value from numbering_system
Browse files Browse the repository at this point in the history
  • Loading branch information
sffc committed Dec 16, 2024
1 parent e90591f commit 889b35c
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions components/decimal/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ pub use format::FormattedFixedDecimal;

use alloc::string::String;
use fixed_decimal::SignedFixedDecimal;
use icu_locale_core::extensions::unicode::Value;
use icu_locale_core::locale;
use icu_locale_core::preferences::{
define_preferences, extensions::unicode::keywords::NumberingSystem,
Expand Down Expand Up @@ -245,7 +246,13 @@ impl FixedDecimalFormatter {
/// assert_eq!(fmt_bn.numbering_system(), "beng");
/// assert_eq!(fmt_zh_nu.numbering_system(), "hanidec");
/// ```
pub fn numbering_system(&self) -> String {
self.symbols.get().numsys().into()
pub fn numbering_system(&self) -> Value {
match Value::try_from_str(self.symbols.get().numsys()) {
Ok(v) => v,
Err(e) => {
debug_assert!(false, "Problem converting numbering system ID to Value: {e}");
Value::new_empty()
}
}
}
}

0 comments on commit 889b35c

Please sign in to comment.