That is the right math to map from 0-255 to 0-100, and has been made properly generic to handle different ranges (for example, if you sometime wanted to use a 16b instead of 8b)
In reply to Re: Normalizing a range of numbers to a percentage
by pryrt
in thread Normalizing a range of numbers to a percentage
by stevieb
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |