Struct NumberFormat
#[repr(transparent)]
pub struct NumberFormat { /* private fields */ }
The Intl.NumberFormat object is a constructor for objects
that enable language sensitive number formatting.
Implementations
impl NumberFormat
fn format_range(&self, start: &JsString, end: &JsString) -> Result<JsString, JsValue>Formats a range of numbers according to the locale and formatting options of this
Intl.NumberFormatobject.Accepts numeric strings for BigInt/arbitrary precision (e.g.,
"123n"→"123", or use E notation:"1000000E-6"→"1").Throws a
TypeErrorif the values are invalid.
impl NumberFormat
fn supported_locales_of(locales: &Array, options: &Object) -> ArrayThe
Intl.NumberFormat.supportedLocalesOf()method returns an array containing those of the provided locales that are supported in number formatting without having to fall back to the runtime's default locale.
impl NumberFormat
fn format(&self) -> FunctionThe Intl.NumberFormat.prototype.format property returns a getter function that formats a number according to the locale and formatting options of this NumberFormat object.
impl NumberFormat
fn format_range_to_parts(&self, start: &JsString, end: &JsString) -> Result<Array<NumberRangeFormatPart>, JsValue>Returns an array of locale-specific tokens representing each part of the formatted number range.
Accepts numeric strings for BigInt/arbitrary precision (e.g.,
"123n"→"123", or use E notation:"1000000E-6"→"1").Throws a
TypeErrorif the values are invalid.
impl NumberFormat
fn format_to_parts(&self, number: f64) -> ArrayThe
Intl.Numberformat.prototype.formatToParts()method allows locale-aware formatting of strings produced by NumberTimeFormat formatters.
impl NumberFormat
fn resolved_options(&self) -> ObjectThe
Intl.NumberFormat.prototype.resolvedOptions()method returns a new object with properties reflecting the locale and number formatting options computed during initialization of this NumberFormat object.
impl NumberFormat
fn new(locales: &Array, options: &Object) -> NumberFormatThe
Intl.NumberFormatobject is a constructor for objects that enable language sensitive number formatting.
Trait Implementations
impl AsRef<JsValue> for NumberFormat
fn as_ref(&self) -> &JsValue
impl AsRef<NumberFormat> for NumberFormat
fn as_ref(&self) -> &NumberFormat
impl AsRef<Object> for NumberFormat
fn as_ref(&self) -> &Object
impl Clone for NumberFormat
fn clone(&self) -> Self
impl Debug for NumberFormat
fn fmt(&self, f: &mut Formatter<'_>) -> Result
impl Default for NumberFormat
fn default() -> Self
impl Deref for NumberFormat
type Target = Object;fn deref(&self) -> &Object
impl ErasableGeneric for NumberFormat
type Repr = JsValue;
impl From<JsValue> for NumberFormat
fn from(obj: JsValue) -> Self
impl FromWasmAbi for NumberFormat
type Abi = <JsValue as FromWasmAbi>::Abi;unsafe fn from_abi(js: Self::Abi) -> Self
impl IntoJsGeneric for NumberFormat
where
NumberFormat: JsGeneric,
type JsCanon = NumberFormat;fn to_js(self) -> NumberFormat
impl IntoWasmAbi for NumberFormat
type Abi = <JsValue as IntoWasmAbi>::Abi;fn into_abi(self) -> Self::Abi
impl JsCast for NumberFormat
fn instanceof(val: &JsValue) -> boolfn unchecked_from_js(val: JsValue) -> Selffn unchecked_from_js_ref(val: &JsValue) -> &Self
impl LongRefFromWasmAbi for NumberFormat
type Abi = <JsValue as LongRefFromWasmAbi>::Abi;type Anchor = NumberFormat;unsafe fn long_ref_from_abi(js: Self::Abi) -> Self::Anchor
impl OptionFromWasmAbi for NumberFormat
fn is_none(abi: &Self::Abi) -> bool
impl OptionIntoWasmAbi for NumberFormat
fn none() -> Self::Abi
impl Promising for NumberFormat
type Resolution = NumberFormat;
impl RefFromWasmAbi for NumberFormat
type Abi = <JsValue as RefFromWasmAbi>::Abi;type Anchor = ManuallyDrop<NumberFormat>;unsafe fn ref_from_abi(js: Self::Abi) -> Self::Anchor
impl UpcastFrom<NumberFormat> for NumberFormat
impl WasmDescribe for NumberFormat
fn describe()