Rectify issues with mismatched types float64 and int

This commit is contained in:
Katos
2024-07-12 21:15:07 +01:00
committed by GitHub
parent c39a65ec21
commit 0a72fa95b3

View File

@@ -99,8 +99,9 @@ func (ctrl *V1Controller) GetLocationWithPrice(auth context.Context, GID uuid.UU
}
for _, item := range items.Items {
// Include quantity in the calculation
itemTotal := big.NewInt(int64(item.PurchasePrice * item.Quantity * 100))
// Convert item.Quantity to float64 for multiplication
quantity := float64(item.Quantity)
itemTotal := big.NewInt(int64(item.PurchasePrice * quantity * 100))
totalPrice.Add(totalPrice, itemTotal)
}