diff --git a/metar.html b/metar.html
index 7892dca..1ab4070 100644
--- a/metar.html
+++ b/metar.html
@@ -98,6 +98,11 @@
return text;
}
+ function decodeVariableWind(code) {
+ const [dir1, dir2] = code.split('V');
+ return `${code}: Wind variable between ${dir1}° and ${dir2}°`;
+ }
+
function decodeVisibility(code) {
const vis = code.replace('SM', '');
return `${code}: Visibility ${vis} statute miles`;
@@ -579,6 +584,8 @@
if (part.endsWith('KT')) {
sections.push({ raw: part, decoded: decodeWind(part) });
+ } else if (part.match(/^\d{3}V\d{3}$/)) {
+ sections.push({ raw: part, decoded: decodeVariableWind(part) });
} else if (part.endsWith('SM') || part.match(/^\d+$/)) {
sections.push({ raw: part, decoded: decodeVisibility(part) });
} else if (part.match(/^([+-]|VC)?(MI|PR|BC|DR|BL|SH|TS|FZ|DZ|RA|SN|SG|IC|PL|GR|GS|UP|BR|FG|FU|VA|DU|SA|HZ|PY|PO|SQ|FC|SS|DS|TR)+$/)) {