Page 1 of 1

mySQL two decimal point

Posted: Fri Feb 22, 2019 9:28 am
by Mohd Izzar

Hi, I have counter some issue. In mysql, the data show two decimal point eg: 30.08. But, when call the database to apperry io, my data become like this, 30.079999923706055. Is there any solution so that I can get only to two decimal point.

Thanks


mySQL two decimal point

Posted: Fri Feb 22, 2019 3:41 pm
by Serhii Kulibaba

You can change the format on the server side (if you use API Express Visual Builder) on the client side with a code:preMath.round(30.079999923706055 * 100)/100/pre
Just replace that static value with your variable.

It is related to a data format you use there. It has to be a string, not a number


mySQL two decimal point

Posted: Thu Feb 28, 2019 1:45 am
by Mohd Izzar

Thanks Serhii