By the way, I couldn't mention it yesterday but I made an adaptation to your code and got a different result despite using the formula? It's strange. I'll share with you:
https://gist.github.com/CryptoSharon/f087061508d78e6a7db218f28bae595a
I'm not really sure why but it's much more far off than yours. Maybe I did something wrong?
I edited my code to divide by / 10000 because why not... And it's much more similar lmao. It actually matches PeakD right now but it didn't yesterday. Strange!
FIXED
Lmao I hadn't noticed I had a * 10000 instead of a * weight / 10000. I double and triple checked last night but it was too late hahah, guess I was half asleep.
I checked again today and saw the * 10000 first time around. I added the weight parameter and divided by 10k instead and it seems to work well :)
It's already updated on the gist
RE: Calculating the USD Vote Value for a Hive account