fix(awareness): wrap north-bound bearings

This commit is contained in:
Rudy Celekli committed 2026-10-25 13:28:23 -04:00
1 parent 496d024431
commit 63866c201a
4 files changed
+26 -2

No files matched your search

+10
View File
@@ -0,0 +1,10 @@
/**
* Format a compass direction for the awareness overlay.
* @param {number} degrees
* @returns {string}
*/
export function formatAwarenessDirection(degrees) {
if (!Number.isFinite(degrees)) return '—';
const normalized = ((degrees % 360) + 360) % 360;
return String(Math.round(normalized) % 360).padStart(3, '0');
}