From 78165e32c7fa41325d72c47b83f6f3c18c75ac6a Mon Sep 17 00:00:00 2001 From: Ines Falcao <70115704+egeofalcao@users.noreply.github.com> Date: Fri, 28 Oct 2022 17:42:22 +1300 Subject: [PATCH] fix: fix typo (#44) --- src/utils/bearing.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/utils/bearing.ts b/src/utils/bearing.ts index 79e76d8e..84425080 100644 --- a/src/utils/bearing.ts +++ b/src/utils/bearing.ts @@ -50,11 +50,11 @@ export const convertDDToDMS = (dd: number | null, showPositiveSymbol = true, add if (dd === 0) addTrailingZeros = false; // toFixed rounds parts up greater than 60, which has to be corrected below - const [bearingWholeString, beringDecimalString] = dd.toFixed(5).split("."); + const [bearingWholeString, bearingDecimalString] = dd.toFixed(5).split("."); let bearingWhole = Math.abs(parseInt(bearingWholeString)); - let minNumeric = parseInt(beringDecimalString?.substring(0, 2)); - let secNumeric = parseInt(beringDecimalString?.substring(2, 4)); + let minNumeric = parseInt(bearingDecimalString?.substring(0, 2)); + let secNumeric = parseInt(bearingDecimalString?.substring(2, 4)); // If the toFixed caused rounding beyond 60 minutes/seconds then apply the carry if (secNumeric >= 60) { @@ -71,7 +71,7 @@ export const convertDDToDMS = (dd: number | null, showPositiveSymbol = true, add const minString = minNumeric.toString().padStart(2, "0"); const secString = secNumeric.toString().padStart(2, "0"); - const deciSecString = beringDecimalString?.substring(4, 5); + const deciSecString = bearingDecimalString?.substring(4, 5); let dmsString = `${showPositiveSymbol && dd > 0 ? "+" : ""}${dd < 0 ? "-" : ""}${bearingWhole}°`; if (addTrailingZeros || deciSecString != "0") {