Transformations: Add round() to Unary mode of Add field from calc (#101295)

This commit is contained in:
Leon Sorokin
2025-02-25 15:50:32 +02:00
committed by GitHub
parent f3433fd472
commit 2e78bcfb41
@@ -4,6 +4,7 @@ export enum UnaryOperationID {
Abs = 'abs',
Exp = 'exp',
Ln = 'ln',
Round = 'round',
Floor = 'floor',
Ceil = 'ceil',
}
@@ -35,6 +36,12 @@ export const unaryOperators = new Registry<UnaryOperatorInfo>(() => {
operation: (value: number) => Math.log(value),
unaryOperationID: UnaryOperationID.Ln,
},
{
id: UnaryOperationID.Round,
name: 'Round',
operation: (value: number) => Math.round(value),
unaryOperationID: UnaryOperationID.Round,
},
{
id: UnaryOperationID.Floor,
name: 'Floor',