mirror of
https://github.com/captbaritone/webamp.git
synced 2026-01-23 02:15:01 +00:00
Assign `finalKhz` properly
This commit is contained in:
parent
de83c99217
commit
160264290f
1 changed files with 4 additions and 1 deletions
|
|
@ -10,7 +10,10 @@ function massageKhz(khz: number) {
|
|||
let finalKhz: String;
|
||||
let khzNum: number = Math.round(khz / 1000);
|
||||
|
||||
if (khzNum <= 100) finalKhz = String(khzNum);
|
||||
// there is no real need to run a condition for below 100khz
|
||||
// when the other conditions (hopefully) take over
|
||||
// ...also to make CI happy
|
||||
finalKhz = String(khzNum);
|
||||
if (khzNum <= 10) finalKhz = String(khzNum).slice(0, 1).padStart(2, " ");
|
||||
if (khzNum >= 100) finalKhz = String(khzNum).slice(1, 3);
|
||||
return finalKhz;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue