]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-2838 Fix manual measure edit (float displayed instead of int)
authorFabrice Bellingard <fabrice.bellingard@sonarsource.com>
Fri, 21 Sep 2012 08:45:09 +0000 (10:45 +0200)
committerFabrice Bellingard <fabrice.bellingard@sonarsource.com>
Fri, 21 Sep 2012 08:46:04 +0000 (10:46 +0200)
=> When editing the integer value of a manual measure, the edition
   mode display a double value

sonar-server/src/main/webapp/WEB-INF/app/models/manual_measure.rb

index 452f3b8278dd6541e6f31770e3e34cae675402c1..86dc7b7c23b3029a398b1c51be80305a00d9f1b8 100644 (file)
@@ -96,7 +96,9 @@ class ManualMeasure < ActiveRecord::Base
       return ''
     end
 
-    if metric.numeric?
+    if metric.value_type==Metric::VALUE_TYPE_INT
+      value ? value.to_i.to_s : ''
+    elsif metric.numeric?
       value ? value.to_s : ''
     elsif metric.value_type==Metric::VALUE_TYPE_BOOLEAN
       value ? (value==1 ? 'Yes' : 'No') : ''