see, i wanted to display a decimal number correctly because if the number has the decimal .10, .20, .30, etc.., it would only show up as 0.1 and not 0.10
i've already checked the other questions for this such as this, but even the top answer didn't solve my problem as it still only showed 1 digit. here's what i tried so far, but seemed to not work:
if(coins%0.10===0)
{
coins=coins+'0';
}
else
{
coins=coins;
}
EDIT: Okay, now i feel reaaaally dumb. I tried .toFixed(2) before i asked this question, but it previously showed up as 0.1 so i tried something else which is the one above. And then I tried .toFixed(2) again when i saw the answers and it now displays correctly. Idk what happened to be honest. And no, I did not mistype the function or anything or missed a semi-colon.
Thank you!