mirumee / django-prices

Django fields for the prices module
158 stars 52 forks source link

Normalize only when there is no decimal points #42

Closed szewczykmira closed 7 years ago

codecov-io commented 7 years ago

Codecov Report

Merging #42 into master will increase coverage by 0.22%. The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #42      +/-   ##
==========================================
+ Coverage   88.65%   88.88%   +0.22%     
==========================================
  Files           5        5              
  Lines         194      198       +4     
  Branches       23       25       +2     
==========================================
+ Hits          172      176       +4     
  Misses         12       12              
  Partials       10       10
Impacted Files Coverage Δ
django_prices/templatetags/prices.py 100% <100%> (ø) :arrow_up:
django_prices/templatetags/prices_i18n.py 93.54% <100%> (+0.21%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update a350f2c...8601d5b. Read the comment docs.

patrys commented 7 years ago

Why do we want/need this? What's the point of calling normalize if there is no decimal point?

szewczykmira commented 7 years ago

@patrys Because one of our clients wants to cut decimal points only when decimal points are equal to 0.

patrys commented 7 years ago

Ok, I misunderstood the intent. In this case can't we call normalize and then inspect the result instead of calling divmod? It feels like a workaround.

szewczykmira commented 7 years ago

@patrys can you check if it looks okey?