Re: Tax calculation problem

This WebDNA talk-list message is from

2003


It keeps the original formatting.
numero = 50168
interpreted = N
texte = Mark D. Laws wrote: > I'm having a problem with the way WebDNA rounds our tax calculations. > The POS system we enter our web orders into for fulfillment rounds up at > .005. WebDNA does not, so we have a lot of transaction that are off by > .01¢.If your POS is _always_ rounding up at .005, it is wrong, see below.> > Example: an item costs $46.00. Our tax rate here is 8.25% (.0825). The > underlying value is 3.795. WebDNA calculates the tax as $3.79, our POS > systems calculates it as $3.40. > I have to guess that you mistyped and your POS returns $3.80, which is the correct value for financial calculations (in most countries). This is somewhat confusing, so I will first include a brief description of Bankers or Even Rounding:=============================== Bankers rounding is the same as plain rounding except that in the case of a tie, increment the digit at the specified decimal place if necessary to make it an even number. A tie occurs when the digit to the right of the one at the specified decimal place equals 5, and there are no following non-zero digits. ===============================To show you the practical effect of this, here is a table of roundings:Raw Rounded 3.795 3.80 3.785 3.78 3.775 3.78 3.765 3.76 3.755 3.76As you see, every other 0.005 is rounded up, the rest are truncated, such that the last resulting digit is always rounded to an even digit. There are somewhat complicated reasons why this is the the preferred method employed by financial institutions.In this instance, I'm not sure how WebDNA is getting to 3.79, since even with simple rounding it should be rounding up here. It is possible that the code is using truncating rounding by default (which is never correct).You can use the Precision header of the shopping cart to prevent WebDNA from rounding on it's own (which of course requires you to to the work), or you can just eat the penny. Lastly, you can do what we do and place a notice on the invoice page that all totals are approximate and that a final accounting will reflect actual charges (for example, shipping).HTHJohn-- John Peacock Director of Information Research and Technology Rowman & Littlefield Publishing Group 4501 Forbes Boulevard Suite H Lanham, MD 20706 301-459-3366 x.5010 fax 301-429-5748 ------------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://webdna.smithmicro.com/ Associated Messages, from the most recent to the oldest:

    
  1. Re: Tax calculation problem (John Peacock 2003)
  2. Re: Tax calculation problem (Tim Robinson 2003)
  3. Tax calculation problem (Mark D. Laws 2003)
Mark D. Laws wrote: > I'm having a problem with the way WebDNA rounds our tax calculations. > The POS system we enter our web orders into for fulfillment rounds up at > .005. WebDNA does not, so we have a lot of transaction that are off by > .01¢.If your POS is _always_ rounding up at .005, it is wrong, see below.> > Example: an item costs $46.00. Our tax rate here is 8.25% (.0825). The > underlying value is 3.795. WebDNA calculates the tax as $3.79, our POS > systems calculates it as $3.40. > I have to guess that you mistyped and your POS returns $3.80, which is the correct value for financial calculations (in most countries). This is somewhat confusing, so I will first include a brief description of Bankers or Even Rounding:=============================== Bankers rounding is the same as plain rounding except that in the case of a tie, increment the digit at the specified decimal place if necessary to make it an even number. A tie occurs when the digit to the right of the one at the specified decimal place equals 5, and there are no following non-zero digits. ===============================To show you the practical effect of this, here is a table of roundings:Raw Rounded 3.795 3.80 3.785 3.78 3.775 3.78 3.765 3.76 3.755 3.76As you see, every other 0.005 is rounded up, the rest are truncated, such that the last resulting digit is always rounded to an even digit. There are somewhat complicated reasons why this is the the preferred method employed by financial institutions.In this instance, I'm not sure how WebDNA is getting to 3.79, since even with simple rounding it should be rounding up here. It is possible that the code is using truncating rounding by default (which is never correct).You can use the Precision header of the shopping cart to prevent WebDNA from rounding on it's own (which of course requires you to to the work), or you can just eat the penny. Lastly, you can do what we do and place a notice on the invoice page that all totals are approximate and that a final accounting will reflect actual charges (for example, shipping).HTHJohn-- John Peacock Director of Information Research and Technology Rowman & Littlefield Publishing Group 4501 Forbes Boulevard Suite H Lanham, MD 20706 301-459-3366 x.5010 fax 301-429-5748 ------------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://webdna.smithmicro.com/ John Peacock

DOWNLOAD WEBDNA NOW!

Top Articles:

Talk List

The WebDNA community talk-list is the best place to get some help: several hundred extremely proficient programmers with an excellent knowledge of WebDNA and an excellent spirit will deliver all the tips and tricks you can imagine...

Related Readings:

how realize an advertiser ? (2005) Repeating Fields (1997) Re[2]: ftp access on Macos X (2000) RE: File Uploads (1998) Multiple Stores and WebCatalog Prefs (1997) Search results templates (1996) Bug? (1997) can WC render sites out? (1997) hmmm (2006) Tags in the header (2000) Search design (1997) 'page impression' techniques for banner ads (1999) WebCat2b15MacPlugin - [protect] (1997) Shopping cart problem (2003) Credit card processing - UK (1997) Shownext! (1998) Navigator 4.01 (1997) triggers have stopped once again (2002) Alais Shopping Cart Directory (1998) RE: combining strings (1997)