Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello there
So i have a problem.
In my mssql salestable i have 3 columns.
BuyinPrice (Bigdecimal)
SalesPrice (Bigdecimal)
Amount (float)
I need to make this calculation to see how much i earn on each sale. And write that into my target db in a INT column.
SalesPrice*Amount-BuyinPrice*Amount = WINNING (int)
I made mistakes before when i calculated that rounded things up so i got the wrong value in the end.
Can someone help me with the code i have to use in tmap in my variable that counts this.
Is this Correct?
(row11.SalesPrice.multiply(BigDecimal.valueOf(row11.Amount))).subtract(row11.BuyinPrice.multiply(BigDecimal.valueOf(row11.Amount)))
and then (int)Var.fromabove.doubleValue()