mirror of
https://github.com/yogstation13/Yogstation.git
synced 2025-02-26 09:04:50 +00:00
15 lines
508 B
Plaintext
15 lines
508 B
Plaintext
// Ensure the frequency is within bounds of what it should be sending/recieving at
|
|
/proc/sanitize_frequency(frequency, free = FALSE)
|
|
. = round(frequency)
|
|
if(free)
|
|
. = Clamp(frequency, MIN_FREE_FREQ, MAX_FREE_FREQ)
|
|
else
|
|
. = Clamp(frequency, MIN_FREQ, MAX_FREQ)
|
|
if(!(. % 2)) // Ensure the last digit is an odd number
|
|
. += 1
|
|
|
|
// Format frequency by moving the decimal.
|
|
/proc/format_frequency(frequency)
|
|
frequency = text2num(frequency)
|
|
return "[round(frequency / 10)].[frequency % 10]"
|