mirror of
https://github.com/technix/ham_radio.git
synced 2024-08-19 04:34:09 +02:00
10 lines
324 B
Lua
10 lines
324 B
Lua
function ham_radio.validate_frequency(frequency)
|
|
local num_freq = tonumber(frequency)
|
|
local freq = tostring(num_freq)
|
|
return freq == frequency
|
|
and num_freq ~= nil
|
|
and num_freq == math.floor(num_freq)
|
|
and num_freq >= ham_radio.settings.frequency.min
|
|
and num_freq <= ham_radio.settings.frequency.max
|
|
end
|