Bug report #14549

Preserve trailing zeros in print composer attribute table

Added by Kilian Hagemann over 8 years ago. Updated over 5 years ago.

Status:Closed
Priority:Normal
Assignee:-
Category:Map Composer/Printing
Affected QGIS version:master Regression?:No
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:end of life
Crashes QGIS or corrupts data:No Copied to github as #:22522

Description

Whenever I insert an attribute table with virtual numeric data into my print composer, QGIS drops any trailing zeros. For example, if I round my dynamic field ($length, $area, $X ...) to two decimal digits, 12.50 becomes 12.5 and 58.00 becomes 58. Scientifically speaking, there's quite a difference between 58 and 58.00 so trailing zeros should be preserved.

I've attached a sample project with sample shapefile and print composer which demonstrates the problem. I tested this on both 2.8.7 and 2.14.0.

Regarding implementation, the easiest way would probably be to remove the code that removes trailing zeros. In the event that the current behaviour is desired for whatever reason (i.e. a feature, not a bug ;-), the better solution would be a tick box to toggle between the two or a fully fledged number formatting option like there currently is for labels, with customised number of decimal places.

trailing_zero_bug.zip - Sample shapefile and project with print composer (6.83 KB) Kilian Hagemann, 2016-03-23 03:12 AM

History

#1 Updated by Giovanni Manghi over 8 years ago

  • Affected QGIS version changed from 2.8.7 to master

#2 Updated by Giovanni Manghi over 7 years ago

  • Easy fix? set to No
  • Regression? set to No

#3 Updated by eino jaskari over 6 years ago

Has there been any attempt to fix this issue?

#4 Updated by Giovanni Manghi over 5 years ago

  • Resolution set to end of life
  • Status changed from Open to Closed

Also available in: Atom PDF