From 0a72fa95b3a0cf3bbaf58f4edeb27f61e55e4813 Mon Sep 17 00:00:00 2001 From: Katos <7927609+katosdev@users.noreply.github.com> Date: Fri, 12 Jul 2024 21:15:07 +0100 Subject: [PATCH] Rectify issues with mismatched types float64 and int --- backend/app/api/handlers/v1/v1_ctrl_locations.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/backend/app/api/handlers/v1/v1_ctrl_locations.go b/backend/app/api/handlers/v1/v1_ctrl_locations.go index a2498ec1..8bd403bc 100644 --- a/backend/app/api/handlers/v1/v1_ctrl_locations.go +++ b/backend/app/api/handlers/v1/v1_ctrl_locations.go @@ -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) }