K.S. Posted May 25, 2017 Share Posted May 25, 2017 Hi, all!I have 2 Integer Fields: Val1 and Val2. And I want to calculate the division of two values. I create Variable_1 with a Expression new DecimalFormat("0.00").format($F{Val1} / $F{Val2}).For example Val1 =349 and Val2 = 335. According to the expression I get Variable_1 = 1.00I need the expression to be Variable_1 = 1.04What I'm doing wrong in this case? Link to comment Share on other sites More sharing options...
mlopez_1 Posted May 25, 2017 Share Posted May 25, 2017 Try to use: String.format("%.2f", $F{Val1}.intValue() / $F{Val2}.intValue())Mariano Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now