formatter
Static object.
Static class containing methods for formatting measurement units depending on the current language.
Methods
Name |
Returns |
Description |
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). |
|
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:
Parameter |
Default value |
Description |
— |
Type: Number Length in meters. |
|
2 |
Type: Integer Number of significant digits in the response. |
* Mandatory parameter/option.
duration
{String} duration(value[, significantDigits])
Returns string representation of duration.
Parameters:
Parameter |
Default value |
Description |
— |
Type: Number Duration in seconds. |
|
2 |
Type: Integer Number of significant digits in the response. |
* Mandatory parameter/option.
Mandatory parameter/option.