* Generates a random latitude. * * @param options An options object. * @param options.max The upper bound for the latitude to generate. Defaults to `90`. * @param options.min The lower bound for the latitude to generate. Defaults to `-90`. * @param options.precision The number of deci
(
options: {
/**
* The upper bound for the latitude to generate.
*
* @default 90
*/
max?: number;
/**
* The lower bound for the latitude to generate.
*
* @default -90
*/
min?: number;
/**
* The number of decimal points of precision for the latitude.
*
* @default 4
*/
precision?: number;
} = {}
)
| 43 | * @since 8.0.0 |
| 44 | */ |
| 45 | latitude( |
| 46 | options: { |
| 47 | /** |
| 48 | * The upper bound for the latitude to generate. |
| 49 | * |
| 50 | * @default 90 |
| 51 | */ |
| 52 | max?: number; |
| 53 | /** |
| 54 | * The lower bound for the latitude to generate. |
| 55 | * |
| 56 | * @default -90 |
| 57 | */ |
| 58 | min?: number; |
| 59 | /** |
| 60 | * The number of decimal points of precision for the latitude. |
| 61 | * |
| 62 | * @default 4 |
| 63 | */ |
| 64 | precision?: number; |
| 65 | } = {} |
| 66 | ): number { |
| 67 | const { max = 90, min = -90, precision = 4 } = options; |
| 68 | |
| 69 | return this.faker.number.float({ min, max, fractionDigits: precision }); |
| 70 | } |
| 71 | |
| 72 | /** |
| 73 | * Generates a random longitude. |
no test coverage detected