Issue converting the values from Scientific E-notation
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hello Community,
I need help in converting below values with E notation:
-5.9604644775390625E-8
-7.4505805969238281E-9
5.9604644775390625E-8
-5.9604644775390625E-8
2.9802322387695313E-8
2.9103830456733704E-11
-1.1059455573558807E-9
1.862645149230957E-9
Any help is much appreciated!
Solved! Go to Solution.
- Labels:
- Transformation
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
The ToNumber function works fine here! These are very small number so they won't display, but they are there
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
tonumber(regex_replace([_Currentfield_],"^(-*\d\.\d+)(E.*)$","$1"))*(pow(10,
tonumber(regex_replace([_Currentfield_],"^(-*\d\.\d+)E(-*\d+)$","$2"))))
use a new fixed_decimal field (say 39.36)- the key part is the part after the .... the above is written for a multi-field formula - but you could create a new column in a generic formula.
@alexnajm 's formula works as well - I'd recommend using a fixed decimal here - not a double or float.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi,
I tried both the solutions and able to see the correct values but its showing null for values without E notation.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
mine would need to be wrapped in a contains.
if contains([_CurrentField_],"E") then
tonumber(regex_replace([_Currentfield_],"^(-*\d\.\d+)(E.*)$","$1"))*(pow(10,
tonumber(regex_replace([_Currentfield_],"^(-*\d\.\d+)E(-*\d+)$","$2"))))
else tonumber([_CurrentField_] endif
not sure why @alexnajm 's wouldn't work for your data.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
If you have tried both solutions, please send us a sample data set and workflow with the two options so @apathetichell and I can troubleshoot - getting a screenshot of the output doesn't show us if the configuration was correct!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Thank you so much, here is the sample data.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
I'm on 2023.1 version
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Ok - did the workflow work then?
![](/skins/images/5A278AAD67B5F68761E04A0A1AFFBB3D/responsive_peak/images/icon_anonymous_message.png)