on 04-26-2012 11:19 AM
Hi All,
I need to convert exponential format to Decimal number format in PI 7.0, Kindly suggest me.
Regards,
Manikandan
Hi,
You need a simple UDF for that purpose:
BigDecimal myNumber = new BigDecimal(input);
double myDouble = myNumber.doubleValue();
return myDouble;
This is for Execution Type = Single Values and a single input parameter called simply input. Then you simply develop the mapping as source -> UDF -> target, where source is an exponential number and target is a "normal" decimal number.
Hope this helps,
Greg
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Greg, I also have a similar requirement and I may get the source field as 2.1E5 or even as 7.88327. I need to convert the exponential values as 21000000 and should pass values such as 7.88327 as it is. I cannot use formatNumber as the no. of decimal points are not fixed and I don't want any redundant zeroes because of formatNumber...The above code does not compile and gives error cannot find symbol pointing towards Bigdecimal...
User | Count |
---|---|
95 | |
11 | |
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.