Jump to content

In the dice game bet results always have 4 digits, even if it should be 1, 2 or 3 (again)


toohoola

Featured Comment

Posted

I've posted about this bug before here and mentioned it again here. Yet I created another topic, because I play a lot of dice here and it's annoying for me. So I've checked the sources and I think I located the issue.

In file 'src/games/Dice/components/Original/Slider/Slider.js' line #60:

const num = diceRoll === false ? '' : diceRoll.toPrecision(4);

You can check it in console:

console.log((12.34).toPrecision(4)); // '12.34'
console.log(( 1.23).toPrecision(4)); // '1.230'
console.log(( 0.12).toPrecision(4)); // '0.1200'
console.log(( 0.1 ).toPrecision(4)); // '0.1000'

The ending zeroes (x.xx0 and x.xx00) are totally unnecessary, since you can't roll any number in that range.

I'm not sure what values diceRoll can take, but, if I'm right then you don't need to call any method on it, because it's in the correct format already, so this should do it:

const num = diceRoll === false ? '' : diceRoll;

Or if you'd like to keep the remaining zeroes (for example 0.10 instead of 0.1)

const num = diceRoll === false ? '' : diceRoll.toFixed(2);

 

Posted

@Josh can you please take a look at this. The 4 numbers aren't appearing for me.

Also was there any changes made to wager time restrictions? As stated here:

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

Privacy Policy Terms of Use