-
Notifications
You must be signed in to change notification settings - Fork 10
Open
Description
Based on the sites example, they seem to truncate after 2 decimals, no rounding. I had to multiply by 100000000 then divide.
Had to use a custom toFixedTrunc func to truncate value.
https://stake.com/provably-fair/calculation?clientSeed=a&game=limbo&nonce=23&serverSeed=a
case 'Limbo':
//100000000 / (81089656 + 1) * (1 - 0.01) = 1.220870868895154
const bytes = Math.floor(this.bytes_to_number(this.bytes(8)) * 100000000);
const result = (100000000 / (bytes + 1) * (1 - 0.01));
return this.toFixedTrunc(result, 2);
Metadata
Metadata
Assignees
Labels
No labels