Handling scientific notation in transforms


Is there an expression engine function that handles scientific notation using E-notation?


Canonical value (read in as a string): '-3.5061761E7'
Transform expression: ???
Desired data value (as a double): -35061761

current workaround is a transform expression like this:
~ expression "matchesRegex(<value>, 'E') ? number(split(<value>, 'E')[0]) * number(split(<value>, 'E')[1]) : <value>'"

but this seems like an operation that should be available in the platform out of the box


posting a solution I just found –

casting the canonical string value as a number looks like it handles this case:


How can I use ExpressionEngineFunction expressions in javascript code?

FYI…This only seems to be working from 7.8. I get the ‘NotImplementedException’ in 7.7


@venkata.paruchuri that error might be due to discrepancies between the methods available in Expr.eval vs. ExpressionEngineFunction library, and still could work in transformation logic. See this post for more context.

Can anyone on the Platform Team shed some light on this? @trothwein or @rohit.sureka?