I have been learning JavaScript in odd and made this function in POS. It works great, but I want to set the decimal precision to the result number so it only has two decimals.
I've searched a lot and tried different things but none worked for me.
I hope someone have an answer for this.
Example:
1 / 3 = 0.3333333333333333 I want the result to be only 0.33
2 / 3 = 0.6666666666666667 I want the result to be only 0.67
This is the code:
test: function()(
if (this. bigger){return(this. quantity*3)}
if (this. smaller){return(this. quantity/3)}
return this.
quantity