This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.
/**
* ROUND_HALF_UP 四舍五入,使用 Number.EPSILON 修正浮点误差(GD-10)
*/
export function roundHalfUp(value: number, decimals: number): number {
const factor = 10 ** decimals;
return Math.round((value + Number.EPSILON) * factor) / factor;
}