From 996a62f55a10db9897ec27dced7c72580c1da454 Mon Sep 17 00:00:00 2001 From: Justin Georgi Date: Wed, 2 Apr 2025 15:39:29 -0700 Subject: [PATCH] Improve rad to deg handling Signed-off-by: Justin Georgi --- modules/glmv-mvconfig.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/glmv-mvconfig.js b/modules/glmv-mvconfig.js index 5d5315c..32e598c 100644 --- a/modules/glmv-mvconfig.js +++ b/modules/glmv-mvconfig.js @@ -135,8 +135,9 @@ orb2degree = function(orbString, fix = null) { } if (fix) { degArray = degArray.map((v, idx) => { - let fixReg = new RegExp('(\\d*.\\d{' + (((typeof fix) == 'object') ? fix[idx] : fix) + '})(\\d*)([a-z]*)') - return v.replace(fixReg,'$1$3') + //let fixReg = new RegExp('(-?\\d*\\.\\d{' + (((typeof fix) == 'object') ? fix[idx] : fix) + '})(\\d*)([a-z]*)') + //return v.replace(fixReg,'$1$3') + return Number.parseFloat(v).toFixed((typeof fix == 'object') ? fix[idx] : fix) + v.substring(v.search(/[a-z]/)) }) } return degArray.join(' ')