rajeevt Posted March 14, 2007 Share Posted March 14, 2007 I am trying to show a calculated field as a percentage. I have given the field type of BigDecimal and created an expression to display as one decimal percent. My expression is: ($F{available}- $F{booked})/($F{available} - $F{sup_booked}) It works correctly when $F(available) and $F{booked} arenot same. When they are it gives 0 and it seems that the report requires 0.0 so I created the following expression: ($F{available}- $F{booked}) == 0? 0.0 : ($F{available}- $F{booked})/($F{available} - $F{sup_booked}) This one works fine but fails when both $F(available) and $F{booked} are zero. Surely there must be a straightforward way of doing this calculation. Can somebody point out what I am doing wrong? RegardsRajeev 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