on 03-20-2009 10:44 AM
I am trying to convert exponential '2.3100000000000000E+02' value to decimal number in MII.
Is there any predefined function in MII which I can use for this conversion?
any help is appreciated.
Hi
Try this:
exp("2.3100000000000000E+02")
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
No Manisha, you are getting 231 there by multiplying it by 100, that should now be the case.
In 2.3100000000000000E+02, the BASE is 2.3100000000000000 and EXPONENT is 2,
= 2.31 * 10^2 = 231.
I also tried doing this manually number(stringleft( "2.3100000000000000E02" , 18 )) * 10^ number(stringright( "2.3100000000000000E02" , 3 )) This works fine but when I try passing this value at run time dynamically I get an error with stringright saying - index out of range
number(stringleft( ForEachRecord.Output(/Row/Name) , 18 )) * 10^ number(stringright( ForEachRecord.Output(/Row/Name) , 3 ))
This throws an error only stringright function.
Srinivas (and Pedro),
I see that it is now closed, but since I put the script together, I will post it anyway.
First do a conditional block with Input1 = stringindexof(Transaction.TestNumber, "E") to determine if the input is in scientific notation. If it is in scientific notation, convert to number format using:
number(stringleft(Transaction.TestNumber,stringindexof(Transaction.TestNumber, "E") - 1)) * (10 ^ number((stringpart(Transaction.TestNumber, (stringindexof(Transaction.TestNumber, "E") + 1), stringlength(Transaction.TestNumber) - stringindexof(Transaction.TestNumber, "E")))
Otherwise simply use the number as is.
NOTE: in 12.1 scientific notation is interpreted as a number, not a string.
Best Regards,
Mike
User | Count |
---|---|
11 | |
6 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.