Formatted Text

Updated:

A component that displays a formatted text.

Properties

Learn more about properties.

format

The format style for the number.

  • decimal: Standard number formatting, locale-aware (default).
  • percent: Percentage formatting, locale-aware.
locale

Formats to the language provided. Accepts multiple locales in an array as sequential fallbacks.

maximumFractionDigits
maximum-fraction-digits

The maximum number of fraction digits to use.

minimumFractionDigits
minimum-fraction-digits

The minimum number of fraction digits to use.

minimumIntegerDigits
minimum-integer-digits

The minimum number of integer digits to use.

signDisplay
sign-display

Determine how the positive or negative sign should display.

Behavior:

  • always: Always display the sign.
  • auto: Sign displays for negative numbers only, including negative zero.
  • exceptZero: Sign displays for positive and negative numbers, but not zero.
  • never: Never display the sign.
size

Applies styling based on the size provided. If no size is provided, it will display as inline text.

value

The value you want formatted.

Release Notes

Initial Release

The following CSS variables are available to override the default theme styles of the q2-formatted-text component.