FAQ: How do I format a number to two decimal places?

Note

โŒ› Article is more than two years old.

Say you want to calculate the average password age, in days, of Admin and Standard user accounts and then round those values to a whole number:

logscale
#event_simpleName=UserLogon
| groupBy(UserIsAdmin, function=(avg(PasswordLastSet, as=avgPswdAge)))
| AvgPaswdAgeDays := now() - (avgPswdAge*1000)
| AvgPaswdAgeDays := AvgPaswdAgeDays/1000/60/60/24
| format("%,.0f",field=["AvgPaswdAgeDays"], as="PasswordLastSetDaysRounded")