Keep It Simple, Stupid | |
PerlMonks |
Re^3: Adding numbers from a loopby 1nickt (Canon) |
on Aug 07, 2019 at 02:25 UTC ( [id://11104072]=note: print w/replies, xml ) | Need Help?? |
You have not said whether the other number is in the database or elsewhere in your code. I assume not in the DB, or you'd just multiply the values in the columns: $sum += ($record->{total} * $record->{price});. If from another source, and you need to look it up, say from a price sheet based on quantity ordered, make yourself a lookup table: Output:
Hope this helps!
The way forward always starts with a minimal test.
In Section
Seekers of Perl Wisdom
|
|