formatDistance

The

formatDistance
function is used to transform numbers into distances.

Do's & Don'ts

Don't use it if you can use the Distance component.

Params

Name
Type
Default
Description
value*
number
The value that is being formatted
unit
mil

|  
km
mil
The unit used that is applied
locale
sv-SE
sv-SE
The locale used to format

Returns

string
: Formatted distance

Examples