CiCiApp / PyInvoice

Invoice/Receipt Generator
MIT License
44 stars 30 forks source link

Invouce amounts rounded to 2 decimals #1

Closed jeroenmac closed 8 years ago

jeroenmac commented 8 years ago

Updated the following: 1) round tax amount to 2 decimals places 2) round subtotal amount to 2 decimal places 3) round total amount to 2 decimal places

zhangshine commented 8 years ago

@jeroenmac Hi, thanks for your PR.

Could you use Decimal.quantize instead of round to round these values to 2 decimals? All tests have failed because round returns different results under different Python versions.

Sorry for my bad english.

jeroenmac commented 8 years ago

Thank you for your feedback.

  1. I've updated the function to use Decimal.quantize
  2. I've added the precision parameter to the constructor
zhangshine commented 8 years ago

@jeroenmac Hi, could you update the test cases? just run python setup test and fix it.

This repo is integrate with travis ci, when the tests failed it will show a :x: icon on the right of your commit message. You can click the icon to see the detail.

jeroenmac commented 8 years ago

Dear,

I've updated the test cases.

Kr, Jeroen