From 09ffa2997a2904727d59a23aea8798fe1cc3772a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9E=97=E6=A6=95=E6=B4=B2?= <347628416@qq.com> Date: Tue, 10 Dec 2024 16:03:48 +0800 Subject: [PATCH] fix(NumberPicker): The hackChrome function lacks the processing of the condition where precision is 0 #4998 --- components/number-picker/number-picker.tsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/components/number-picker/number-picker.tsx b/components/number-picker/number-picker.tsx index 2a45c6a8fa..07cbac4c4a 100644 --- a/components/number-picker/number-picker.tsx +++ b/components/number-picker/number-picker.tsx @@ -452,6 +452,8 @@ class NumberPicker extends React.Component const precision = this.getPrecision(); if (precision > 0) { return Number(Number(value).toFixed(precision)); + } else if (precision === 0) { + return Math.floor(value); } return value; }