From 714dbcb212a6d1af3e401bece7b3c0a53b497b2d Mon Sep 17 00:00:00 2001 From: Anthony Schmidt Date: Tue, 1 Oct 2024 11:42:10 -0700 Subject: [PATCH] update calcweight to handle items not div by 100 --- mbmgemp/GEFUNCS.C | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/mbmgemp/GEFUNCS.C b/mbmgemp/GEFUNCS.C index ffa5e17..eccfe94 100644 --- a/mbmgemp/GEFUNCS.C +++ b/mbmgemp/GEFUNCS.C @@ -2550,12 +2550,15 @@ long FUNC calcweight(wptr) WARSHP *wptr; { int i; -long total = 0; +double totald = 0.0; +long total = 0; for (i=0; iitems[i]*((double)weight[i]/100L)); + totald += (wptr->items[i]*((double)weight[i]/100L)); } + +total = (long)ceil(totald); return (total); }