Convert scientific notation (ex: 7.533992951114973E-4) to float

Im trying to add the actual and typical field to the ML alerts on watcher, is there a method in painless to convert scientific notation to float?

                "actual" : [

maybe something like:

         def actual = "7.533992951114973E-4";
          DecimalFormat df = new DecimalFormat();
          float a = Float.parseFloat((actual));
          return df.format(a);

output would be:

          "new_actual" : [
1 Like

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.