Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[IMP] web: add rounding methods #165189

Closed
wants to merge 1 commit into from

Conversation

mcm-odoo
Copy link
Contributor

@mcm-odoo mcm-odoo commented May 13, 2024

This commit adds rounding methods that already exit in python:

  • DOWN: always rounds towards 0
  • UP: always rounds away from 0
  • HALF-DOWN: rounds to the closest number with ties going towards zero
  • HALF-EVEN: rounds to the closest number with ties going to the closest even number
  • HALF-UP: rounds to the closest number with ties going away from zero (this method was the one implemented before this commit)

task-3918420

@robodoo
Copy link
Contributor

robodoo commented May 13, 2024

@C3POdoo C3POdoo added the RD research & development, internal work label May 13, 2024
addons/web/static/src/core/utils/numbers.js Outdated Show resolved Hide resolved
@mcm-odoo mcm-odoo force-pushed the master-rounding-method-mcm branch from aa6fc45 to f85760f Compare May 15, 2024 11:10
This commit adds rounding methods that already exit in python:
- DOWN: always rounds towards 0
- UP: always rounds away from 0
- HALF-DOWN: rounds to the closest number with ties going towards
  zero
- HALF-EVEN: rounds to the closest number with ties going to the
  closest even number
- HALF-UP: rounds to the closest number with ties going away from
  zero (this method was the one implemented before this commit)

task-3918420
@mcm-odoo mcm-odoo force-pushed the master-rounding-method-mcm branch from f85760f to 36ebda4 Compare May 15, 2024 11:11
Copy link
Contributor

@aab-odoo aab-odoo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

robodoo r+

robodoo pushed a commit that referenced this pull request May 15, 2024
This commit adds rounding methods that already exit in python:
- DOWN: always rounds towards 0
- UP: always rounds away from 0
- HALF-DOWN: rounds to the closest number with ties going towards
  zero
- HALF-EVEN: rounds to the closest number with ties going to the
  closest even number
- HALF-UP: rounds to the closest number with ties going away from
  zero (this method was the one implemented before this commit)

task-3918420

closes #165189

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
robodoo pushed a commit that referenced this pull request May 15, 2024
This commit adds rounding methods that already exit in python:
- DOWN: always rounds towards 0
- UP: always rounds away from 0
- HALF-DOWN: rounds to the closest number with ties going towards
  zero
- HALF-EVEN: rounds to the closest number with ties going to the
  closest even number
- HALF-UP: rounds to the closest number with ties going away from
  zero (this method was the one implemented before this commit)

task-3918420

closes #165189

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
@robodoo robodoo closed this May 15, 2024
@robodoo robodoo added the 17.3 label May 15, 2024
zel-odoo pushed a commit to odoo-dev/odoo that referenced this pull request May 24, 2024
This commit adds rounding methods that already exit in python:
- DOWN: always rounds towards 0
- UP: always rounds away from 0
- HALF-DOWN: rounds to the closest number with ties going towards
  zero
- HALF-EVEN: rounds to the closest number with ties going to the
  closest even number
- HALF-UP: rounds to the closest number with ties going away from
  zero (this method was the one implemented before this commit)

task-3918420

closes odoo#165189

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
17.3 RD research & development, internal work
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants