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" : [
7.533992951114973E-4
],
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" : [
7.533992951114973E-4
],
maybe something like:
def actual = "7.533992951114973E-4";
DecimalFormat df = new DecimalFormat();
df.setMaximumFractionDigits(8);
float a = Float.parseFloat((actual));
return df.format(a);
output would be:
"new_actual" : [
"0.0007534"
]
This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
© 2020. All Rights Reserved - Elasticsearch
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant logo are trademarks of the Apache Software Foundation in the United States and/or other countries.