$\times \frac{255}{65000}$ converts it to a value in 0-255 range.
You can use floor or Ceil functions to make it a whole number (approximates)
How we found it:
I'm denoting value in $0-65000$ scale as $d$, and in $0-255$ scale in $r$.
$65000\equiv 255, d\equiv r\implies 255\times d=65000\times r\implies r=\frac{d\times 255}{65000}$
**Edit:** since you want to translate it to 65000 to 0, easiest way will be $255-\frac{d\times 255}{65000}$