Skip to content

Commit

Permalink
fixed decimal for demo earthquake posisition
Browse files Browse the repository at this point in the history
  • Loading branch information
bagusindrayana committed Apr 20, 2024
1 parent 57aa8a4 commit 2e35a09
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1451,15 +1451,15 @@ ${feature.geometry.coordinates[0]} , ${feature.geometry.coordinates[1]}`;
const randomPosition = turf.randomPosition(bbox);
const mag = (Math.random() * (10 - 5) + 5).toFixed(1);
const depth = (Math.random() * 20).toFixed(1) + " Km";
const message = "Gempa Bumi Test Pada Lokasi : Lat : " + randomPosition[1] + " Lng : " + randomPosition[0] + " Magnitudo : " + mag + " Kedalaman : " + depth;
const message = "Gempa Bumi Test Pada Lokasi : Lat : " + randomPosition[1].toFixed(4) + " Lng : " + randomPosition[0].toFixed(4) + " Magnitudo : " + mag + " Kedalaman : " + depth;
const id = `tg-${new Date().getTime()}`;

const dt = DateTime.now();
const readAbleTime = dt.toISODate() + " " + dt.toLocaleString(DateTime.TIME_24_WITH_SECONDS)
const nig: InfoGempa = {
id: id,
lng: randomPosition[0],
lat: randomPosition[1],
lng: randomPosition[0].toFixed(4),
lat: randomPosition[1].toFixed(4),
mag: parseFloat(mag),
depth: depth || "10 Km",
message: message,
Expand Down

0 comments on commit 2e35a09

Please sign in to comment.