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

Function times

packages/core/src/utils/number.ts:276–282  ·  view source on GitHub ↗
(num1: number, num2: number)

Source from the content-addressed store, hash-verified

274 * Exact multiplication (to resolve loss of precision)
275 */
276export function times(num1: number, num2: number): number {
277 const intNum1 = float2Fixed(num1);
278 const intNum2 = float2Fixed(num2);
279 const baseNum = digitLength(num1) + digitLength(num2);
280 const dividend = intNum1 * intNum2;
281 return dividend / Math.pow(10, baseNum);
282}
283
284/**
285 * Exact division (to resolve loss of precision)

Callers 10

cellValueToStringMethod · 0.90
numberFormatFunction · 0.90
calc2RoundFCMethod · 0.90
funcMethod · 0.90
FilterNumberFunction · 0.90
setEditorValueFunction · 0.90
divideFunction · 0.85
plusFunction · 0.85
minusFunction · 0.85

Calls 2

float2FixedFunction · 0.85
digitLengthFunction · 0.85

Tested by

no test coverage detected