peter.cavanagh1989 Posted July 30, 2013 Share Posted July 30, 2013 HelloI have a filed called amont taken from the database that are not whole numbers and are negative. Is there away i can convert these to positive numbers in ireport? I have tried using java.lang.Math.abs() however this just converts to a whole number.Thanks Link to comment Share on other sites More sharing options...
mgeise Posted July 30, 2013 Share Posted July 30, 2013 multiply by -1 Link to comment Share on other sites More sharing options...
timr_1 Posted December 18, 2015 Share Posted December 18, 2015 If you have both negative and positive amounts, the easiest thing to do is use the ABS() function. In this example, you would double click on the field that contains the "Amount Taken" value to open the Expression Editor. From there you want to select Numeric/Mathematical and double click on the ABS function where you will see ABS() in the Expression Editor. Put your variable inside the () and it will always return a positive value.EXAMPLE:ABS($V{Amount Taken}) 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