on 03-07-2007 8:19 AM
Hi,
I have an incoming field which is xsd:double and I need to convert the field into xsd:decimal
For example:
Incoming field - 5.13964E11
Outgoing field - 513964000.00
Any ideas how to do this ??
Thanks
Colin.
Not required
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Collin,
Use this UDF. I guess this will work for large values too
<b>BigDecimal bd = new BigDecimal(String a);
return bd.toString();</b>
Regards,
Jai Shankar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Colin,
U can use a small UDF.
double input = Double.parseDouble(a);
return (long)input;
Regards,
Jai Shankar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Colin,
you can create a target data type in which you can take outgoing field as string variable.....
then in msg mapping, make a small UDF in JAVA.......take your input field to it....
in UDF, cast the input to double..........then convert it to decimal.....then cast it back to string.......then output this string.......
then take output of UDF to target........so you will get outgoing field in decimal format as string............
Then you can process your target XML in your target system.
Thanks,
Rajeev Gupta
Message was edited by:
RAJEEV GUPTA
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.