on 03-18-2016 1:28 PM
Hi All,
For one of the field NETPR, PI is getting money with decimal values. But my requirement is to truncate all the values from 3rd decimal without rounding of the value.
For example: If NETPR is 5678.546 then output value should be 5678.54 only, but PI should not round off this value to 5678.55.
unfortunately am getting round off output in test results after using "formatNumber" function also.
Below is my mapping :
Can any one please tell me if it can able to handle with UDF help or with in graphical mapping.?
Thanks in Advance.!
--
With regards
Raj
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Raj,
Use below UDF.
Execution type : Single Values
public String decimalNotRounding(String input, Container container) throws StreamTransformationException {
Double f1 = Double.parseDouble(input);
DecimalFormat df = new DecimalFormat(".00");
df.setRoundingMode(RoundingMode.DOWN);
return df.format(f1);
}
Regards,
Praveen.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.