Convert value to scientific notation for negative powers
I was provided a prototype that can convert numerical values into scientific notation for positive powers (ex. 3000 -> 3.00 x 10^3). However, my prototype involves only small values (such as 0.0003) and needs to work for negative powers of 10, I tried modifying the given prototype but failed.
The current prototype works by extracting the value (first three values) from input using substring function, add decimal and 'E' using concat, and add power using count function (input-1).
Since in case of small decimals (ex. 0.0003), the first number to retain will no longer be in the front, I tried to make use of the index function to root out the placement of the first non-zero (also not decimal) value, but as you can see on the pic below, it didn't work saying the highlighted expression is comparative.
I can't think of any other way to detect location of the first non-zero value in a value such as 0.0003.
Do anyone have a working prototype example that I can use?