1
0
mirror of https://github.com/KubaPro010/fm-dx-webserver.git synced 2026-02-26 22:13:53 +01:00

Merge pull request #94 from mrwish7/main

Fix direct frequency entry rounding errors
This commit is contained in:
Marek Farkaš
2024-11-04 12:10:29 +01:00
committed by GitHub

View File

@@ -88,7 +88,7 @@ $(document).ready(function () {
const inputValue = Number(textInput.val()); const inputValue = Number(textInput.val());
// Check if the user agent contains 'iPhone' // Check if the user agent contains 'iPhone'
if (/iPhone/i.test(navigator.userAgent)) { if (/iPhone/i.test(navigator.userAgent)) {
socket.send("T" + (inputValue * 1000)); socket.send("T" + (Math.round(inputValue * 1000)));
// Clear the input field if needed // Clear the input field if needed
textInput.val(''); textInput.val('');
} }
@@ -118,7 +118,7 @@ $(document).ready(function () {
if (event.key === 'Enter') { if (event.key === 'Enter') {
const inputValue = textInput.val(); const inputValue = textInput.val();
if (socket.readyState === WebSocket.OPEN) { if (socket.readyState === WebSocket.OPEN) {
socket.send("T" + (inputValue * 1000)); socket.send("T" + (Math.round(inputValue * 1000)));
} }
textInput.val(''); textInput.val('');
} }
@@ -1129,4 +1129,4 @@ function fillPresets() {
tuneTo(Number(presetText)); tuneTo(Number(presetText));
}); });
} }
} }