How should I convert Wifi signal strength from a Quality in percentage, usually 0% to 100% into an RSSI value, usually a negative dBm number (i.e. -96db)?
-96db
In JS I prefer doing something like:
Math.min(Math.max(2 * (x + 100), 0), 100)
My personal opinion is that it's more elegant way to write it, instead of using if's.
if