]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-4996 Fix display of debt measure
authorJulien Lancelot <julien.lancelot@gmail.com>
Fri, 21 Feb 2014 16:06:45 +0000 (17:06 +0100)
committerJulien Lancelot <julien.lancelot@gmail.com>
Tue, 25 Feb 2014 18:01:22 +0000 (19:01 +0100)
sonar-server/src/main/webapp/WEB-INF/app/models/project_measure.rb

index f00e6089c2bc4c939d9583d2ad378dbc900c375b..53139786ae8d6d36598a23e3513696d062324a47 100644 (file)
@@ -164,11 +164,12 @@ class ProjectMeasure < ActiveRecord::Base
   end
 
   def work_duration_formatted_value(value)
-    if value == 0
+    val = value.to_i
+    if val == 0
       '0'
     else
-      duration = Internal.work_duration_formatter.abbreviation(value.abs).to_s
-      value > 0 ? duration : '-' + duration
+      duration = Internal.work_duration_formatter.abbreviation(val.abs).to_s
+      val > 0 ? duration : '-' + duration
     end
   end