From: Fabrice Bellingard Date: Fri, 21 Sep 2012 08:45:09 +0000 (+0200) Subject: SONAR-2838 Fix manual measure edit (float displayed instead of int) X-Git-Tag: 3.3~260 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=368737eb0438d232c7ac0e5f84b1e0e59832ab98;p=sonarqube.git SONAR-2838 Fix manual measure edit (float displayed instead of int) => When editing the integer value of a manual measure, the edition mode display a double value --- diff --git a/sonar-server/src/main/webapp/WEB-INF/app/models/manual_measure.rb b/sonar-server/src/main/webapp/WEB-INF/app/models/manual_measure.rb index 452f3b8278d..86dc7b7c23b 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/models/manual_measure.rb +++ b/sonar-server/src/main/webapp/WEB-INF/app/models/manual_measure.rb @@ -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') : ''