API Reference
@univerjs
@univerjs/engine-formula
functions
Striperrormargin

@univerjs/engine-formula v0.1.17Docs


Function: stripErrorMargin()

function stripErrorMargin(num, precision): number

Tolerance for the results of accuracy issues to tolerate certain errors

Why 12? This is an empirical choice. Generally, choosing 12 can solve most of the 0001 and 0009 problems. e.g. floor(5,1.23) = 0.0800000000000001

Parameters

ParameterTypeDefault value
numnumberundefined
precisionnumber12

Returns

number

Defined in

packages/engine-formula/src/engine/utils/math-kit.ts:195 (opens in a new tab)


Copyright © 2021-2024 DreamNum Co,Ltd. All Rights Reserved.