Opened 8 years ago
Closed 8 years ago
#28967 closed Bug (fixed)
Cast with FloatField rounds value to integer on MySQL
| Reported by: | Sergey Fedoseev | Owned by: | Sergey Fedoseev | 
|---|---|---|---|
| Component: | Database layer (models, ORM) | Version: | 1.10 | 
| Severity: | Normal | Keywords: | |
| Cc: | Triage Stage: | Accepted | |
| Has patch: | no | Needs documentation: | no | 
| Needs tests: | no | Patch needs improvement: | no | 
| Easy pickings: | no | UI/UX: | no | 
Description
In [6]: DurationModel.objects.annotate(f=models.functions.Cast(0.125, models.FloatField())).first().f Out[6]: 0.0 In [7]: DurationModel.objects.annotate(f=models.functions.Cast(0.5, models.FloatField())).first().f Out[7]: 1.0
Change History (4)
comment:1 by , 8 years ago
| Owner: | changed from to | 
|---|---|
| Status: | new → assigned | 
comment:2 by , 8 years ago
| Triage Stage: | Unreviewed → Accepted | 
|---|
comment:3 by , 8 years ago
  Note:
 See   TracTickets
 for help on using tickets.
    
PR