From 978550e0f14e8eced9e360fd818d75955f2a6cf9 Mon Sep 17 00:00:00 2001 From: andrea rota Date: Fri, 23 Sep 2022 16:51:38 +0100 Subject: [PATCH] apply rounding after division (should fix: MARXAN-1798) --- .../src/modules/surface-cost/adapters/typeorm-cost-surface.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/apps/geoprocessing/src/modules/surface-cost/adapters/typeorm-cost-surface.ts b/api/apps/geoprocessing/src/modules/surface-cost/adapters/typeorm-cost-surface.ts index d5ff01b683..40a1fca2fe 100644 --- a/api/apps/geoprocessing/src/modules/surface-cost/adapters/typeorm-cost-surface.ts +++ b/api/apps/geoprocessing/src/modules/surface-cost/adapters/typeorm-cost-surface.ts @@ -39,7 +39,7 @@ export class TypeormCostSurface implements CostSurfacePersistencePort { await this.entityManager.query( ` INSERT INTO scenarios_pu_cost_data (scenarios_pu_data_id, cost) - SELECT spd.id, round(pug.area) / 1000000 as area + SELECT spd.id, round(pug.area / 1000000) as area FROM scenarios_pu_data spd INNER JOIN projects_pu ppu ON ppu.id = spd.project_pu_id INNER JOIN planning_units_geom pug ON pug.id = ppu.geom_id