Skip to main content

FormatDigital

shadow

The FormatDigital component is designed to format numeric values into a human-readable digital format with respect to various unit prefixes such as kilo, mega, giga, etc. It offers options to customize units, display style of units and supports localization.

Basic usage

Display options

Byte formatting

Formatting bits

Use with slots

Attributes and Properties

value

DescriptionThe value to be formatted. Specifies the size in bytes or bits to display.
Attributevalue
Typenumber | string
Defaultundefined

unit

DescriptionFormatting unit. Valid values are 'bit' or 'byte'.
Attributeunit
Typestring
Default"byte"

unitDisplay

DescriptionUnit display style. Valid values are 'short', 'long' or 'narrow'.
Attributeunit-display
Typestring
Default"short"

Events

No events available for this component.

Methods

No public methods available for this component.

CSS Shadow Parts

NameDescription
nativeRefers to the main container of the element
formattedRefers to the element containing the formatted value

CSS Custom Properties

No CSS custom properties available for this component.

Slots

NameDescription
startContent placed before the formatted value.
endContent placed after the formatted value.