A very nice function. Thanks for that.
Another way is using a table: function print_tv(val)
local i = val + 19+15
local tv_str = {"2048","1625","1290","1024","812","645","512","406","322",
"256","203","161","128","101","80","64","50","40","32","25",
"20","15","13","10","8","6","5","4","3.2","2.5","2","1.6",
"1.3","1.0","0.8","0.6","0.5","0.4","0.3","1/4","1/5","1/6",
"1/8","1/10","1/13","1/15","1/20","1/25","1/30","1/40","1/50",
"1/60","1/80","1/100","1/125","1/160","1/200","1/250","1/320",
"1/400","1/500","1/640","1/800","1/1000","1/1250","1/1600",
"1/2000","1/2500","1/3200","1/4000","1/5000","1/6400","1/8000","1/10000"}
if (i > #tv_str) or (i < 1) then
return "n/a"
else
return tv_str[i]
end
end
print(print_tv(get_tv96()/32))
msl