Skip to content

Commit a167ff2

Browse files
Mark JessopMark Jessop
authored andcommitted
Round frequency data to 1 kHz on display
1 parent 799cf03 commit a167ff2

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

js/sondehub.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1369,6 +1369,11 @@ function habitat_data(jsondata, data_ages, current_timestamp, alternative) {
13691369
}
13701370
}
13711371

1372+
// Round frequency data
1373+
if(k === "frequency"){
1374+
v = v.toFixed(3);
1375+
}
1376+
13721377
// Check if data is considered to be 'old'
13731378
// Need to think about how to style old data.
13741379
// Maybe make the text grey?
@@ -2865,7 +2870,7 @@ function mapInfoBox_handle_path_new(data, vehicle, date) {
28652870
if (data.hasOwnProperty("tx_frequency")) {
28662871
html += "<div><b>TX Frequency:&nbsp;</b>" + data.tx_frequency + " MHz</div>";
28672872
} else if (data.hasOwnProperty("frequency")) {
2868-
html += "<div><b>Frequency:&nbsp;</b>" + data.frequency + " MHz</div>";
2873+
html += "<div><b>Frequency:&nbsp;</b>" + data.frequency.toFixed(3) + " MHz</div>";
28692874
};
28702875
if (data.hasOwnProperty("humidity")) {
28712876
html += "<div><b>Relative Humidity:&nbsp;</b>" + data.humidity + " %</div>";

0 commit comments

Comments
 (0)