colinmrice Posted October 4, 2011 Share Posted October 4, 2011 Code:Hi, I have an ETL job that uses the tMap control to map a BigDecimal input field to a BigDecimal output field. The result in the output field should be Raw.TranAmount * 0.07, as seen below: Raw.TransactionType == 1 && Raw.AgentNo > 100000 ? Raw.TranAmount * 0.07 : 0 However I get java compilation errors saying that 'The operator * is undefined for the argument type(s) BigDecimal, double'. If I try the following: Raw.TransactionType == 1 && Raw.AgentNo > 100000 ? 10 * 0.07 : 0 that works fine, so I know it is just having a problem multiplying the value from field Raw.TranAmount with 0.07. I've tried various java/groovy functions like .multiply but still no good. Surely someone must have needed to do this before. Any suggestions? Thanks Colin Link to comment Share on other sites More sharing options...
colinmrice Posted October 4, 2011 Author Share Posted October 4, 2011 Found a resolution to this on the Talend forge forum: Raw.TransactionType == 1 && Raw.AgentNo > 100000 ? Raw.TranAmount.multiply(BigDecimal.valueOf(0.07)) : new java.math.BigDecimal(0) 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