Class NumberFormat
java.lang.Object
org.jboss.elemento.intl.NumberFormat
@JsType(isNative=true,
namespace="<global>",
name="Intl.NumberFormat")
public class NumberFormat
extends Object
Mapping for
Intl.NumberFormat.
double number = 123456.789;
console.log(numberFormat("de-DE", numberFormatOptions()
.style(currency)
.currency("EUR"))
.format(number));
// Expected output: "123.456,79 €"
// The Japanese yen doesn't use a minor unit
console.log(numberFormat("ja-JP", numberFormatOptions()
.style(currency)
.currency("JPY"))
.format(number));
// Expected output: "¥123,457"
// Limit to three significant digits
console.log(numberFormat("en-IN", numberFormatOptions()
.maximumSignificantDigits(3))
.format(number));
// Expected output: "1,23,000"
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionformat(double number) formatRange(double start, double end) elemental2.core.JsArray<jsinterop.base.JsPropertyMap<String>> formatRangeToParts(double start, double end) elemental2.core.JsArray<jsinterop.base.JsPropertyMap<String>> formatToParts(double number) static NumberFormatstatic NumberFormatnumberFormat(String locale) static NumberFormatnumberFormat(String[] locales) static NumberFormatnumberFormat(String[] locales, NumberFormatOptions options) static NumberFormatnumberFormat(String locale, NumberFormatOptions options) static NumberFormatnumberFormat(Locale locale) static NumberFormatnumberFormat(Locale[] locales) static NumberFormatnumberFormat(Locale[] locales, NumberFormatOptions options) static NumberFormatnumberFormat(Locale locale, NumberFormatOptions options) static NumberFormatnumberFormat(NumberFormatOptions options) jsinterop.base.JsPropertyMap<String> static elemental2.core.JsArray<String> supportedLocalesOf(String locale) static elemental2.core.JsArray<String> supportedLocalesOf(String locale, SupportOptions options) static elemental2.core.JsArray<String> supportedLocalesOf(jsinterop.base.JsArrayLike<String> locales) static elemental2.core.JsArray<String> supportedLocalesOf(jsinterop.base.JsArrayLike<String> locales, SupportOptions options)
-
Method Details
-
numberFormat
-
numberFormat
-
numberFormat
-
numberFormat
-
numberFormat
-
numberFormat
-
numberFormat
-
numberFormat
-
numberFormat
-
numberFormat
-
supportedLocalesOf
-
supportedLocalesOf
public static elemental2.core.JsArray<String> supportedLocalesOf(String locale, SupportOptions options) -
supportedLocalesOf
-
supportedLocalesOf
public static elemental2.core.JsArray<String> supportedLocalesOf(jsinterop.base.JsArrayLike<String> locales, SupportOptions options) -
format
-
formatToParts
-
formatRange
-
formatRangeToParts
public elemental2.core.JsArray<jsinterop.base.JsPropertyMap<String>> formatRangeToParts(double start, double end) -
resolvedOptions
-