TrackerList compute 'sum' returns "7.105427357601E-015"
- Status
- Open
- Subject
- TrackerList compute 'sum' returns "7.105427357601E-015"
- Version
- 12.x
- Category
- Usability
- Feature request
- Feature
- Trackers
- Resolution status
- New
- Submitted by
- Mike Finko
- Lastmod by
- Xavier de Pedro
- Rating
- Description
When using TrackerList compute function (sum of a column), sometimes it returns the number: 7.105427357601E-015
This is reported on several php forums and is not a bug but: "its the acceptable precision of floating point numbers" or also described as "Subtracting 2 floats returns incorrect results".
Seems that a workaround patch may be necessary as one post suggests:
"so I guess you need to hack it: if ($resultB < 0.000) $resultB = 0;"Here are links:
http://forums.oscommerce.com/topic/199647-php-math-bug-big-problem/https://bugs.php.net/bug.php?id=41213&edit=1
br,
Mike- Workaround
Use mathematical calculation field instead
https://doc.tiki.org/Mathematical+Calculation+Tracker+Fieldwith the advanced syntax:
https://doc.tiki.org/Advanced+RatingOr the new features added in TableSorter in Tiki15 for sums and averages of data in the table, etc.: param "tstotals".
The compute field is deprecated (risky, security-wise) and will not be extended anymore, I'm afraid.- Importance
- 5
- Priority
- 25
- Demonstrate Bug on Tiki 19+
-
This bug has been demonstrated on show2.tiki.org
Please demonstrate your bug on show2.tiki.org
Show.tiki.org is not configured properlyThe public/private keys configured to connect to show2.tiki.org were not accepted. Please make sure you are using RSA keys. Thanks.
- Demonstrate Bug (older Tiki versions)
-
This bug has been demonstrated on show.tikiwiki.org
Please demonstrate your bug on show.tikiwiki.org
Show.tiki.org is not configured properlyThe public/private keys configured to connect to show.tikiwiki.org were not accepted. Please make sure you are using RSA keys. Thanks.
- Ticket ID
- 5968
- Created
- Wednesday 01 June, 2016 14:46:00 UTC
by Mike Finko - LastModif
- Thursday 02 June, 2016 07:43:27 UTC