Documentation
Reference
2.1.50 (current version)
collection
interactivityModel
Interfaces
2.1.51 (release candidate)
collection
interactivityModel
Interfaces

formatter

Static object.

Static class containing methods for formatting measurement units depending on the current language.

Methods

formatter()

Methods

NameReturnsDescription
distance(value[, significantDigits])

String

Returns string representation of distance formatted for the locale being used, and converted to the appropriate measurement system (for example, for en-US, distance will be in miles).

duration(value[, significantDigits])

String

Returns string representation of duration.

Methods details

distance

{String} distance(value[, significantDigits])

Returns string representation of distance formatted for the locale being used, and converted to the appropriate measurement system (for example, for en-US, distance will be in miles).

Parameters:

ParameterDefault valueDescription
value*
[no-highlight[

* Mandatory parameter/option.

]no-highlight]

Type: Number

Length in meters.

significantDigits 2

Type: Integer

Number of significant digits in the response.

* Mandatory parameter/option.

duration

{String} duration(value[, significantDigits])

Returns string representation of duration.

Parameters:

ParameterDefault valueDescription
value*
[no-highlight[

* Mandatory parameter/option.

]no-highlight]

Type: Number

Duration in seconds.

significantDigits 2

Type: Integer

Number of significant digits in the response.

* Mandatory parameter/option.