convertDistance() (static) #
Deprecated since 2.14.0
Converts a distance string to a number of meters.
Arguments #
static convertDistance(distance: string): number;| Arguments | Type | Description |
|---|---|---|
distance | string | Distance with its unit, in the format accepted by the geoDistance clause (e.g. "1.5km", "500 meters") |
Return #
The convertDistance function returns the distance in meters.
Usage #
import { Koncorde } from 'kuzzle';
Koncorde.convertDistance('1.5km'); // 1500