Modify ↓
Opened 15 years ago
Closed 15 years ago
#7703 closed defect (fixed)
Totals not accurate when values are not integers
| Reported by: | Daniel Smith | Owned by: | Rob Guttman |
|---|---|---|---|
| Priority: | normal | Component: | SumFieldsPlugin |
| Severity: | normal | Keywords: | |
| Cc: | Trac Release: | 0.11 |
Description
If the numbers for a given column are not integers (say they are floats) the sum field will be incorrect.
Patch file with suggested fix is attached
Attachments (1)
Change History (5)
Changed 15 years ago by
| Attachment: | patch.diff added |
|---|
comment:1 Changed 15 years ago by
comment:2 Changed 15 years ago by
--- templates/sumfields.html (revision 8998)
+++ templates/sumfields.html (working copy)
@@ -%ld,%ld +%ld,%ld @@
// sum up each row
jQuery('.${field}', this).each(function(){
- var num = parseInt($(this).text());
+ var num = parseFloat($(this).text());
if (!isNaN(num)){
sums['${field}'] += num;
}
comment:3 Changed 15 years ago by
comment:4 Changed 15 years ago by
| Resolution: | → fixed |
|---|---|
| Status: | new → closed |
Note: See
TracTickets for help on using
tickets.



--- templates/sumfields.html (revision 8998) +++ templates/sumfields.html (working copy) @@ -%ld,%ld +%ld,%ld @@
+ var num = parseFloat($(this).text());