Jump to content
We've recently updated our Privacy Statement, available here ×

Dividing double returning null value


amartin_2
Go to solution Solved by nuno-miguel-lourenco,

Recommended Posts

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()))

Link to comment
Share on other sites

  • Replies 3
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

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?

 

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...