2017-07-27 5 views
-1

コードライン値変数に格納された値を持っているのGroovyスクリプトを持っている:私はそれを持っている場合origEstTotal 2桁を四捨五入したい私は私が2桁に四捨五入したいとリターンが

def origEst = issue.getOriginalEstimate() 
origEst = new Float(issue.getOriginalEstimate()/3600) 

def origEstTotal = origEst.floatValue() 

return origEstTotal 

を10進数値です。

答えて

0

あなたは、単にround(int precision)使用することができます。

def origEstTotal = new Float(123.00954) 
def origEstTotalRounded = origEstTotal.floatValue().round(2) 
println origEstTotalRounded 

プリント

123.01 
関連する問題