Library API
⬅ Back to Guides
Preparing search index...
common.index
formatUnit
Function formatUnit
formatUnit
(
value
:
number
,
unit
:
string
,
locale
?:
string
,
unitDisplay
?:
"long"
|
"short"
|
"narrow"
|
undefined
,
)
:
string
return a localized unit string (e.g., '2 days')
Parameters
value
:
number
unit
:
string
Optional
locale
:
string
unitDisplay
:
"long"
|
"short"
|
"narrow"
|
undefined
= 'long'
Returns
string
Settings
Member Visibility
Protected
Inherited
External
Theme
OS
Light
Dark
⬅ Back to Guides
Library API
Loading...
return a localized unit string (e.g., '2 days')