Mongodb convert amount into 0E-14 while updating negative value(-1.1231) with $inc function

I am working on some kind of trading platform. So i have maintain balance of account of users. When trading happen, order are settle, at that time transactions are created very fast on same account.

So I am using $inc function to add or subtract amount from user accounts. I faced lots of issue because when i was subtracting fractional values e.g. 0.001 from 0.003 then $inc function create issue. i was not getting correct value.

Now my balance field data type is Decimal128. my previous issue was resolved but it convert value like this .e.g 1.45057300000000. if i keep subtracting amount from this balance. Mongodb convert it into
0E-14.

Anyone can help me. I want my amount maximum with 6 decimal and correct amount. if i have 0.00000001 this much balance in account then database will show me same value.

Is it possible??????

If someone help me. i will appreciate
1 person has
this question
+1
Reply