chandesaisalvin Posted January 31, 2021 Share Posted January 31, 2021 HiI have been tinkering wtih this software for the first time for about a week.TLDR;So on my price label I have . . . "$" + ($F{pro_price1} == null ? $F{Price1}.setScale(2) : $F{pro_price1}.setScale(2))I have a suggested price which is "SRP: $" + $F{Sugg_Price}.setScale(2) . . . . This is in a different body I went to style, add a condition, I added a condition where $F{Price1}<$F{Sugg_Price} than selected lets say Time New Roman and the font size. So I want the font to change where if the Price is less than the SRP it is a font I selected. I enter it into my POS website and get an error like so 1. The operator < is undefined for the argument type(s) java.math.BigDecimal, java.math.BigDecimal value = ((java.math.BigDecimal)field_Price1.getValue())<((java.math.BigDecimal)field_Sugg_Price.getValue()); //$JR_EXPR_ID=13$ <-------------------------------------------------------------------------------------------------> 2. The operator < is undefined for the argument type(s) java.math.BigDecimal, java.math.BigDecimal value = ((java.math.BigDecimal)field_Price1.getOldValue())<((java.math.BigDecimal)field_Sugg_Price.getOldValue()); //$JR_EXPR_ID=13$ <-------------------------------------------------------------------------------------------------------> 3. The operator < is undefined for the argument type(s) java.math.BigDecimal, java.math.BigDecimal value = ((java.math.BigDecimal)field_Price1.getValue())<((java.math.BigDecimal)field_Sugg_Price.getValue()); //$JR_EXPR_ID=13$ <-------------------------------------------------------------------------------------------------> 3 errors . Link to comment Share on other sites More sharing options...
jgust Posted January 31, 2021 Share Posted January 31, 2021 Unless you absolutely need to use BigDecimal, which is an arbitarary-precision decimal type, I would consider changing it to double, which is a primitive double-precision. This will allow you to do your simple math without all of the grief. 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