rs5 [direct: primary] wl_gp_local> db.player_balance.updateMany({player_id: "646210805c9d4fc15d0fcd87" }, { $set: { balance: 500.03 } })
{
acknowledged: true,
insertedId: null,
matchedCount: 1,
modifiedCount: 0,
upsertedCount: 0
}
rs5 [direct: primary] wl_gp_local> db.player_balance.find({player_id:"646210805c9d4fc15d0fcd87"});
[
{
_id: ObjectId('646210805c9d4fc15d0fcd8a'),
tenant_id: '6461fc3c4ff7f71988060223',
player_id: '646210805c9d4fc15d0fcd87',
balance: 500.03,
provider_id: null,
updated_at: ISODate('2023-05-15T10:59:12.105Z'),
created_at: ISODate('2023-05-15T10:59:12.105Z')
}
]
rs5 [direct: primary] wl_gp_local> db.player_balance.updateMany({player_id: "646210805c9d4fc15d0fcd87" }, { $inc: { balance: 0.03 } })
{
acknowledged: true,
insertedId: null,
matchedCount: 1,
modifiedCount: 1,
upsertedCount: 0
}
rs5 [direct: primary] wl_gp_local> db.player_balance.find({player_id:"646210805c9d4fc15d0fcd87"});
[
{
_id: ObjectId('646210805c9d4fc15d0fcd8a'),
tenant_id: '6461fc3c4ff7f71988060223',
player_id: '646210805c9d4fc15d0fcd87',
balance: 500.05999999999995,
provider_id: null,
updated_at: ISODate('2023-05-15T10:59:12.105Z'),
created_at: ISODate('2023-05-15T10:59:12.105Z')
}
]
rs5 [direct: primary] wl_gp_local> db.player_balance.updateMany({player_id: "646210805c9d4fc15d0fcd87" }, { $set: { balance: 500.04 } })
{
acknowledged: true,
insertedId: null,
matchedCount: 1,
modifiedCount: 1,
upsertedCount: 0
}
rs5 [direct: primary] wl_gp_local> db.player_balance.find({player_id:"646210805c9d4fc15d0fcd87"});
[
{
_id: ObjectId('646210805c9d4fc15d0fcd8a'),
tenant_id: '6461fc3c4ff7f71988060223',
player_id: '646210805c9d4fc15d0fcd87',
balance: 500.04,
provider_id: null,
updated_at: ISODate('2023-05-15T10:59:12.105Z'),
created_at: ISODate('2023-05-15T10:59:12.105Z')
}
]
rs5 [direct: primary] wl_gp_local> db.player_balance.updateMany({player_id: "646210805c9d4fc15d0fcd87" }, { $inc: { balance: 0.03 } })
{
acknowledged: true,
insertedId: null,
matchedCount: 1,
modifiedCount: 1,
upsertedCount: 0
}
rs5 [direct: primary] wl_gp_local> db.player_balance.find({player_id:"646210805c9d4fc15d0fcd87"});
[
{
_id: ObjectId('646210805c9d4fc15d0fcd8a'),
tenant_id: '6461fc3c4ff7f71988060223',
player_id: '646210805c9d4fc15d0fcd87',
balance: 500.07,
provider_id: null,
updated_at: ISODate('2023-05-15T10:59:12.105Z'),
created_at: ISODate('2023-05-15T10:59:12.105Z')
}
]
rs5 [direct: primary] wl_gp_local>
when I try to self update(increment) balance column when value is between 500.01 to 500.03 by value 0.03 then balance becomes 500.05999999999995. and when I try to self update of value greater than or equal to 500.04 by 0.03 then result is 500.07. why such rounding up is happening before getting added and sometimes rounding not happening after added.
Please check all above queries you will understand the scenario I am trying to explain.