Skip to content

Commit

Permalink
fix: round all coordinates to two decimals (#559)
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinKolarik authored Oct 15, 2024
1 parent e703d96 commit caa1e69
Show file tree
Hide file tree
Showing 5 changed files with 80 additions and 80 deletions.
4 changes: 2 additions & 2 deletions src/lib/geoip/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ export default class GeoipClient {
region: match.region,
normalizedCity: match.normalizedCity,
asn: Number(networkMatch.asn),
latitude: Number(match.latitude),
longitude: Number(match.longitude),
latitude: Math.round(Number(match.latitude) * 100) / 100,
longitude: Math.round(Number(match.longitude) * 100) / 100,
network: networkMatch.network,
normalizedNetwork: networkMatch.normalizedNetwork,
isHosting,
Expand Down
4 changes: 2 additions & 2 deletions test/tests/integration/adoption-code.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ describe('Adoption code', () => {
city: 'Dallas',
state: 'TX',
country: 'US',
latitude: 32.7831,
longitude: -96.8067,
latitude: 32.78,
longitude: -96.81,
asn: 20004,
network: 'The Constant Company LLC',
});
Expand Down
40 changes: 20 additions & 20 deletions test/tests/integration/measurement/probe-communication.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ describe('Create measurement request', () => {
city: 'Dallas',
normalizedCity: 'dallas',
asn: 20004,
latitude: 32.7831,
longitude: -96.8067,
latitude: 32.78,
longitude: -96.81,
network: 'The Constant Company LLC',
normalizedNetwork: 'the constant company llc',
}]);
Expand Down Expand Up @@ -127,8 +127,8 @@ describe('Create measurement request', () => {
state: 'TX',
city: 'Dallas',
asn: 20004,
longitude: -96.8067,
latitude: 32.7831,
longitude: -96.81,
latitude: 32.78,
network: 'The Constant Company LLC',
tags: [ 'gcp-us-west4', 'datacenter-network' ],
resolvers: [],
Expand Down Expand Up @@ -173,8 +173,8 @@ describe('Create measurement request', () => {
state: 'TX',
city: 'Dallas',
asn: 20004,
longitude: -96.8067,
latitude: 32.7831,
longitude: -96.81,
latitude: 32.78,
network: 'The Constant Company LLC',
tags: [ 'gcp-us-west4', 'datacenter-network' ],
resolvers: [],
Expand Down Expand Up @@ -214,8 +214,8 @@ describe('Create measurement request', () => {
state: 'TX',
city: 'Dallas',
asn: 20004,
longitude: -96.8067,
latitude: 32.7831,
longitude: -96.81,
latitude: 32.78,
network: 'The Constant Company LLC',
tags: [ 'gcp-us-west4', 'datacenter-network' ],
resolvers: [],
Expand Down Expand Up @@ -268,8 +268,8 @@ describe('Create measurement request', () => {
state: 'TX',
city: 'Dallas',
asn: 20004,
longitude: -96.8067,
latitude: 32.7831,
longitude: -96.81,
latitude: 32.78,
network: 'The Constant Company LLC',
tags: [ 'gcp-us-west4', 'datacenter-network' ],
resolvers: [],
Expand Down Expand Up @@ -344,8 +344,8 @@ describe('Create measurement request', () => {
state: 'TX',
city: 'Dallas',
asn: 20004,
latitude: 32.7831,
longitude: -96.8067,
latitude: 32.78,
longitude: -96.81,
network: 'The Constant Company LLC',
},
tags: [ 'gcp-us-west4', 'datacenter-network' ],
Expand Down Expand Up @@ -394,8 +394,8 @@ describe('Create measurement request', () => {
state: 'TX',
city: 'Dallas',
asn: 20004,
latitude: 32.7831,
longitude: -96.8067,
latitude: 32.78,
longitude: -96.81,
network: 'The Constant Company LLC',
},
tags: [ 'gcp-us-west4', 'datacenter-network' ],
Expand Down Expand Up @@ -437,8 +437,8 @@ describe('Create measurement request', () => {
state: 'TX',
city: 'Dallas',
asn: 20004,
latitude: 32.7831,
longitude: -96.8067,
latitude: 32.78,
longitude: -96.81,
network: 'The Constant Company LLC',
},
tags: [ 'gcp-us-west4', 'datacenter-network' ],
Expand Down Expand Up @@ -480,8 +480,8 @@ describe('Create measurement request', () => {
state: 'TX',
city: 'Dallas',
asn: 20004,
latitude: 32.7831,
longitude: -96.8067,
latitude: 32.78,
longitude: -96.81,
network: 'The Constant Company LLC',
},
tags: [ 'gcp-us-west4', 'datacenter-network' ],
Expand Down Expand Up @@ -523,8 +523,8 @@ describe('Create measurement request', () => {
state: 'TX',
city: 'Dallas',
asn: 20004,
latitude: 32.7831,
longitude: -96.8067,
latitude: 32.78,
longitude: -96.81,
network: 'The Constant Company LLC',
},
tags: [ 'gcp-us-west4', 'datacenter-network' ],
Expand Down
28 changes: 14 additions & 14 deletions test/tests/integration/probes/get-probes.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ describe('Get Probes', () => {
state: null,
city: 'Buenos Aires',
asn: 61004,
latitude: -34.6131,
longitude: -58.3772,
latitude: -34.61,
longitude: -58.38,
network: 'InterBS S.R.L. (BAEHOST)',
},
tags: [],
Expand All @@ -95,8 +95,8 @@ describe('Get Probes', () => {
state: 'TX',
city: 'Dallas',
asn: 20004,
latitude: 32.7831,
longitude: -96.8067,
latitude: 32.78,
longitude: -96.81,
network: 'The Constant Company LLC',
},
tags: [ 'datacenter-network' ],
Expand All @@ -111,8 +111,8 @@ describe('Get Probes', () => {
state: 'NY',
city: 'New York',
asn: 80004,
latitude: 40.7143,
longitude: -74.0060,
latitude: 40.71,
longitude: -74.01,
network: 'The Constant Company LLC',
},
tags: [ 'datacenter-network' ],
Expand All @@ -125,8 +125,8 @@ describe('Get Probes', () => {
city: 'Washington',
continent: 'NA',
country: 'US',
latitude: 38.89539,
longitude: -77.039476,
latitude: 38.90,
longitude: -77.04,
network: 'Verizon Business',
region: 'Northern America',
state: 'DC',
Expand Down Expand Up @@ -162,8 +162,8 @@ describe('Get Probes', () => {
state: null,
city: 'Buenos Aires',
asn: 61004,
latitude: -34.6131,
longitude: -58.3772,
latitude: -34.61,
longitude: -58.38,
network: 'InterBS S.R.L. (BAEHOST)',
},
tags: [],
Expand Down Expand Up @@ -201,8 +201,8 @@ describe('Get Probes', () => {
state: null,
city: 'Buenos Aires',
asn: 61004,
latitude: -34.6131,
longitude: -58.3772,
latitude: -34.61,
longitude: -58.38,
network: 'InterBS S.R.L. (BAEHOST)',
},
stats: { cpu: { load: [] }, jobs: { count: 0 } },
Expand Down Expand Up @@ -243,8 +243,8 @@ describe('Get Probes', () => {
state: null,
city: 'Buenos Aires',
asn: 61004,
latitude: -34.6131,
longitude: -58.3772,
latitude: -34.61,
longitude: -58.38,
network: 'InterBS S.R.L. (BAEHOST)',
},
status: 'ready',
Expand Down
Loading

0 comments on commit caa1e69

Please sign in to comment.