Archive

rounding function round(x,y) returns 100 instead of 99,99

Path Finder

Hi
Lets say I have value of 99.99875547590601 and I want to get only 99,99 so I use the function round(99.99875547590601,2) which returns 100 instead of 99,99.
I think this behaviour might be normal but so what can I do instead of round to get precise result?

Thank you.

Tags (1)
0 Karma

Champion

Hi

Try like

| makeresults 
| eval num=99.99875547590601 
| rex field=num "(?P<output>\d{1,}\.\d{2})"
0 Karma