Hi,
I am trying to calculate percentage.
"script": {
"source": """
return [ ctx.payload.first.aggregations.success_count.doc_count / (ctx.payload.first.aggregations.success_count.doc_count + ctx.payload.first.aggregations.failure_count.doc_count) * 100) ]
""",
"lang": "painless"
}
But it always returns zero which I assume is due to decimal places during the calculation.
Basically, 4/(4+6)*100 should return 40.
Kindly let me know how to fix this.