I need to convert a value from 0 to 255 to a percentage. The number 1000 later corresponds to 1 percent and the number 100.000 later to 100 percent. So the multiplication foldor is 1000, can someone please help me reactivate my synapses? No jokes please. Its late at night in Europe.

Now that you have a working solution I will take the liberty of adding some noise to this thread. I can’t follow the logic behind your equation. In my mind I would first translate the 0-255 values to 0-1 (by dividing v by 255) and the I would scale that to 100000. If I had to read the code in a long time from now this would make more sense TO ME:

result = v / 255 * 100000 'Convert 0-255 values to 0-100000