Help

欢迎!

该社区面向专业人士和我们产品和服务的爱好者。
分享和讨论最好的内容和新的营销理念,建立您的专业形象,一起成为更好的营销人员。


0

POS setting decimal precision to result number in JavaScript

Avatar
odoo
Avatar
Discard
1 Answer
0
Avatar
odoo
Best Answer

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


Avatar
Discard