Describe your bug or feature request.

If you pass a positive integer to Calculator::ceil() the result is incremented by 1
If you pass a negative integer (or zero) to Calculator::floor() the result is decreased by 1

If a bug, provide steps to reproduce it from a clean install.

drush ev 'var_dump(\Drupal\commerce_price\Calculator::ceil("5"));'
drush ev 'var_dump(\Drupal\commerce_price\Calculator::floor("-5"));'
drush ev 'var_dump(\Drupal\commerce_price\Calculator::floor("0"));'

Issue fork commerce-3641105

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

iswilson created an issue. See original summary.

jsacksick’s picture

Version: 4.x-dev » 3.x-dev

  • jsacksick committed 2478baa4 on 3.x
    fix: #3641105 ceil() and floor() in Calculator return wrong result for...

  • jsacksick committed a86c6e80 on 4.x
    fix: #3641105 ceil() and floor() in Calculator return wrong result for...
jsacksick’s picture

Status: Active » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.