Minor change in distance representation

This commit is contained in:
Pax1601
2023-06-06 14:53:46 +02:00
parent f84ff1c7b2
commit ab3a017b55
4 changed files with 39 additions and 705 deletions

View File

@@ -79,8 +79,8 @@ export function reciprocalHeading(heading: number): number {
return heading > 180? heading - 180: heading + 180;
}
export const zeroAppend = function (num: number, places: number) {
var string = String(num);
export const zeroAppend = function (num: number, places: number, decimal: boolean = false) {
var string = decimal? num.toFixed(2): String(num);
while (string.length < places) {
string = "0" + string;
}
@@ -176,4 +176,12 @@ export function ftToM(ft: number) {
export function mToFt(m: number) {
return m / 0.3048;
}
export function mToNm(m: number) {
return m * 0.000539957;
}
export function nmToFt(nm: number) {
return nm * 6076.12;
}