Opened 6 years ago
Last modified 6 years ago
#13405 new defect
sum totalhours returns int instead decimal — at Initial Version
Reported by: | Rochi | Owned by: | Russ Tyndall |
---|---|---|---|
Priority: | normal | Component: | TimingAndEstimationPlugin |
Severity: | normal | Keywords: | |
Cc: | Trac Release: | 1.2 |
Description
Trac 1.2.2
TimingAndEstimationPlugin 1.5.7b0
MariaDB 10.0.34
If I enter a decimal value for hours like 0.5 the totalhours field is always increased to the next integer value (here 1).
The code casts the newvalue with
CAST( newvalue AS DECIMAL)
But if you look to the mysql or mariadb documentation "DECIMAL" is used as "DECIMAL(10,0)" so the scale is 0 (number of digits after the decimal point). see https://mariadb.com/kb/en/library/decimal/ https://dev.mysql.com/doc/refman/5.5/en/fixed-point-types.html
So the cast have to look like
CAST( newvalue AS DECIMAL(10,2))
I've attached a patch.
Note: See
TracTickets for help on using
tickets.
Patch sum totalhours