Defect #13780

Spent hours have excessive flaction in PDF exported ticket list

Added by Toru Haraguchi almost 5 years ago. Updated almost 5 years ago.

Status:ClosedStart date:
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:PDF export
Target version:-
Resolution:Duplicate Affected version:2.2.2

Description

When exporting tickets list view to PDF and a ticket has a particular spent time value, the PDF exported shows excessive fraction digits. The following should be the point to be patched, but please review and fix this problem.

--- a/redmine/lib/redmine/export/pdf.rb
+++ b/redmine/lib/redmine/export/pdf.rb

@@ -251,6 +251,10 @@

             if column.name == :subject
               value = "  " * level + value
             end
+            if column.name == :spent_hours
+              value = "%.2f" % value.to_f
+            end
             if value.is_a?(Date)
               format_date(value)
             elsif value.is_a?(Time)

Attached an example.

error_example1.pdf (276 KB) Toru Haraguchi, 2013-04-16 12:22


Related issues

Related to Redmine - Defect #12510: Issues PDF export: Spent time/Float-values aren't rounded... Closed

History

#1 Updated by Toshi MARUYAMA almost 5 years ago

  • Category set to PDF export

#2 Updated by Toshi MARUYAMA almost 5 years ago

  • Status changed from New to Closed
  • Resolution set to Duplicate

Duplicate with #12510.

Also available in: Atom PDF