Intval is not accurate when rounding float numbers

Created on 23 January 2020, about 5 years ago
Updated 19 February 2025, about 2 months ago

The prices that are transferred to Datatrans are first converted from a float format to integer by intval(), but round() should also be used to have an accurate rounding.

You can read more about this issue here:
https://www.php.net/manual/de/function.intval.php#101439

Here is a demo:
https://3v4l.org/iiBSG

🐛 Bug report
Status

Closed: outdated

Version

1.0

Component

Code

Created by

🇨🇭Switzerland kkri

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024