omarzina / substruct

Automatically exported from code.google.com/p/substruct
0 stars 0 forks source link

patch to truncate total cost #169

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. set tax to calculate a float, like 6.55
2. get an order that doesn't round evenly
3. check the output of order#total

What is the expected output? What do you see instead?
the total should be truncated to two decimals, in case [ex:] a promotion 
gives a percentage off or what not.

authorize.net SIM requires 2 decimals, so this should help that to be the 
case always.

What version of the product are you using? On what operating system?
trunk.

Original issue reported on code.google.com by rogerpack2005 on 21 Feb 2009 at 6:26

Attachments:

GoogleCodeExporter commented 8 years ago
except I'm not sure if truncate is the best option or not--what if people want 
tax to 
round up, for example. Hmm.

Original comment by rogerpack2005 on 21 Feb 2009 at 6:50

GoogleCodeExporter commented 8 years ago
Just to note, if you pass a tax or shipping cost to PayPal that has more than 2 
decimal places, PayPal will completely ignore it.  It is definitely worth 
truncating, 
because I had a couple of orders that were paid for but the shipping cost never 
got 
transferred.

Original comment by solodex2...@gmail.com on 21 Feb 2009 at 7:41

GoogleCodeExporter commented 8 years ago
authorize.net SIM rejects the transaction if a value has more than two 
decimals.  
Perhaps we should add truncation in several locations [?]
-=r

Original comment by rogerpack2005 on 21 Feb 2009 at 9:49

GoogleCodeExporter commented 8 years ago
Roger, any chance of getting you to apply / test this patch on trunk?

Original comment by subim...@gmail.com on 4 May 2010 at 7:19

GoogleCodeExporter commented 8 years ago
sure

Original comment by rogerpack2005 on 4 May 2010 at 9:07

GoogleCodeExporter commented 8 years ago
committed r225

Original comment by rogerpack2005 on 4 May 2010 at 11:35

GoogleCodeExporter commented 8 years ago

Original comment by subim...@gmail.com on 5 May 2010 at 2:22