Sage 100

 View Only
  • 1.  Rounding and VBScript

    Posted 11-12-2020 10:50
    This is a bit of trivia, but I had an issue recently and thought to share.  The problem was we needed to balance an invoice total (for a spreadsheet sent with line details and totals) to a recalculation by a customer system, or the invoice would be rejected.  So I wrote a script to add a /ROUNDING line with pennies (excluded from the spreadsheet) so the invoice total would match the customer calculation method (not rounding line by line, but instead rounding the total).
    The problem is, we kept getting the occasional penny difference, and it turns out this is just how VBScript uses "bankers rounding".

    If you want "normal" rounding, there are options you can use as the 3rd argument.  Reference: link.


    ------------------------------
    Kevin Moyes
    Technical Systems Analyst
    Munjal White Consulting Co.
    Toronto ON
    ------------------------------