Based upon other questions that seem similar, I have tried the following formula. I am getting null. This should be as simple as 3.00/2 and display 1.50 however it is not working it still shows null. I have confirmed that the fields contain values for all fields. The Price Qty field is an integer and the Price field is BigDecimal, but this sets the values to double for the purposes of this variable correct? Anyone know what I am missing?
new Double($V{UnitPrice}.doubleValue() == 0 ? 0 : ($F{Price Qty}.doubleValue()/$F{Price}.doubleValue()))
I removed the "new Double($V{UnitPrice}.doubleValue() == 0 ? 0 : " portion from the above code and it calculates correctly now!!! Thanks for the help! It is giving me.5 I would like to see two decimal places, do you know how to do that?
Sure.
You just need to something like the following:
new java.text.DecimalFormat("#0.00").format(<put your expression here>)