Skip to content

Commit

Permalink
update calcweight to handle items not div by 100
Browse files Browse the repository at this point in the history
  • Loading branch information
manicpop committed Oct 1, 2024
1 parent 36b93de commit 714dbcb
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions mbmgemp/GEFUNCS.C
Original file line number Diff line number Diff line change
Expand Up @@ -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; i<NUMITEMS; ++i)
{
total += (wptr->items[i]*((double)weight[i]/100L));
totald += (wptr->items[i]*((double)weight[i]/100L));
}

total = (long)ceil(totald);
return (total);
}

Expand Down

0 comments on commit 714dbcb

Please sign in to comment.