[geodesy] Fix decimal point type (#45747)

Before this commit, the Dp type (decimal point) was limiting values to 0,
2, and 4. These values are actually default values only, but geodesy
supports any number of decimal points.

See https://github.com/chrisveness/geodesy/issues/83
This commit is contained in:
Sam Herrmann 2020-07-07 15:08:03 -04:00 committed by GitHub
parent 373578f2d8
commit 3252bb429b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 9 deletions

View File

@ -54,23 +54,23 @@ Dms.parse('51° 28 40.12″ N');
Dms.toDms(45);
Dms.toDms(45, 'dm');
Dms.toDms(45, 'd', 2);
Dms.toDms(45, 'dms', 4);
Dms.toDms(45, 'd', 1);
Dms.toDms(45, 'dms', 3);
Dms.toLat(45);
Dms.toLat(45, 'dm');
Dms.toLat(45, 'd', 2);
Dms.toLat(45, 'dms', 4);
Dms.toLat(45, 'd', 1);
Dms.toLat(45, 'dms', 3);
Dms.toLon(45);
Dms.toLon(45, 'dm');
Dms.toLon(45, 'd', 2);
Dms.toLon(45, 'dms', 4);
Dms.toLon(45, 'd', 1);
Dms.toLon(45, 'dms', 3);
Dms.toBrng(90);
Dms.toBrng(90, 'dm');
Dms.toBrng(90, 'd', 2);
Dms.toBrng(90, 'dms', 4);
Dms.toBrng(90, 'd', 1);
Dms.toBrng(90, 'dms', 3);
Dms.compassPoint(180);
Dms.compassPoint(180, 1);

View File

@ -12,7 +12,7 @@
*/
export type Format = 'd' | 'dm' | 'dms';
export type Dp = 0 | 2 | 4;
export type Dp = number;
export interface Plural<T> {
[itemName: string]: T;