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

[4.x]: Various floating point number comparison issues #3403

Open
lukeholder opened this issue Mar 6, 2024 · 3 comments
Open

[4.x]: Various floating point number comparison issues #3403

lukeholder opened this issue Mar 6, 2024 · 3 comments
Labels
bug commerce4 Issues related to Commerce v4

Comments

@lukeholder
Copy link
Member

lukeholder commented Mar 6, 2024

What happened?

Description

Please put any information on any floating point number comparison issues in the comments below.

Related issues:

#1836

Related PRs:

#3385

Craft CMS version

4.x

Craft Commerce version

4.x

PHP version

No response

Operating system and version

No response

Database type and version

No response

Image driver and version

No response

Installed plugins and versions

@lukeholder lukeholder added bug commerce4 Issues related to Commerce v4 labels Mar 6, 2024
@adrum
Copy link

adrum commented Mar 6, 2024

@lukeholder On our non-Craft Commerce projects, we use https://github.com/moneyphp/money which helps abstract away most of the logic. It still takes careful consideration across the board when working with money, as usual.

@lukeholder
Copy link
Member Author

@adrum Thanks, we are using Money in Commerce 5 and it's new Teller class for managing floating point number comparisons until we move to Money objects for all values. I will look to backport these changes to Commerce 4.

@adrum
Copy link

adrum commented May 13, 2024

@lukeholder Have you given any more attention to this particular issue? We came across an issue in production where this caused an order to be "partially paid" when it should've been just "paid", and wasn't sure what to expect on this front.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug commerce4 Issues related to Commerce v4
Projects
None yet
Development

No branches or pull requests

2 participants