MCPcopy Create free account
hub / github.com/apitable/apitable / func

Method func

packages/core/src/formula_parser/functions/numeric.ts:228–237  ·  view source on GitHub ↗
(params: [IFormulaParam<number>, IFormulaParam<number>])

Source from the content-addressed store, hash-verified

226 }
227
228 static override func(params: [IFormulaParam<number>, IFormulaParam<number>]): NumericType {
229 const value = params[0].value;
230 if (value == null) {
231 return null;
232 }
233 const num = Number(value);
234 const precision = params[1] && Math.floor(params[1].value) || 0;
235 const offset = Math.pow(10, precision);
236 return divide(Math.round(times(num, offset)), offset);
237 }
238}
239
240export class Max extends NumericFunc {

Callers

nothing calls this directly

Calls 2

divideFunction · 0.90
timesFunction · 0.90

Tested by

no test coverage detected