I was able to set the decimal precision by using tofixed(2)
the correct code would be like this
test: function()(
if (this. bigger){return(this. quantity*3).
tofixed(2)
}
if (this. smaller){return(this. quantity/3).
tofixed(2)
}
return this. quantity