Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: How to calculate the sum of columns to be equal to 100?

by ambrus (Abbot)
on Aug 15, 2013 at 12:34 UTC ( [id://1049574]=note: print w/replies, xml ) Need Help??


in reply to How to calculate the sum of columns to be equal to 100?

On this exact problem, see summary of solutions for MJD's perl quiz of the week regular #7 from 2002, and an apology about that email containing wrong code. Strangely, I can't seem to find the message where this quiz was posed, nor any solutions sent to the discuss mailing list.

Update: try this search in the archives to find solutions submitted by participants.

  • Comment on Re: How to calculate the sum of columns to be equal to 100?

Replies are listed 'Best First'.
Re^2: How to calculate the sum of columns to be equal to 100?
by Laurent_R (Canon) on Aug 15, 2013 at 13:35 UTC

    Yes, fudging the data is one solution.

    The company for which I work as an independent consultant spent a few years back several hundred thousand euros trying to get their invoices "look right" (about 20 million invoices per month). After a lot of thinking, simulations on Excel, consultations with accountants, auditors and tax advisers, prototyping, etc., it was finally decided that all the invoice individual lines and subtotals would have 5 decimal digits, and only the invoice total (and VAT) would be rounded to the nearest cent. There may still be some rounding differences, but, at least, nobody really cares about a difference of 0.00001 euro.

      I have also seen invoices in which the last line before the invoice total is a "rounding compensation", something like -0.01.
      لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1049574]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (4)
As of 2024-04-25 13:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found