[ES|QL] Fixed round signature to support decimals. (#173915)

## Summary

Added decimals arg to `round` function.

Co-authored-by: Stratoula Kalafateli <efstratia.kalafateli@elastic.co>
This commit is contained in:
Marco Liberati 2024-01-02 14:56:15 +01:00 committed by GitHub
parent 9476dfaed8
commit 0ef910e0e7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -18,9 +18,15 @@ export const evalFunctionsDefinitions: FunctionDefinition[] = [
}),
signatures: [
{
params: [{ name: 'field', type: 'number' }],
params: [
{ name: 'field', type: 'number' },
{ name: 'decimals', type: 'number', optional: true },
],
returnType: 'number',
examples: [`from index | eval round_value = round(field)`],
examples: [
`from index | eval round_value = round(field)`,
`from index | eval round_value = round(field, 2)`,
],
},
],
},