From f07b25f9500b265c2ff345ad18c96dc22bf8771a Mon Sep 17 00:00:00 2001 From: m0_75226990 Date: Thu, 31 Aug 2023 20:12:53 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=20parseFloat=20=E6=B5=8B?= =?UTF-8?q?=E8=AF=95=E7=94=A8=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- uni_modules/uts-tests/utssdk/Number.uts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/uni_modules/uts-tests/utssdk/Number.uts b/uni_modules/uts-tests/utssdk/Number.uts index 3bee379..bd72af1 100644 --- a/uni_modules/uts-tests/utssdk/Number.uts +++ b/uni_modules/uts-tests/utssdk/Number.uts @@ -50,6 +50,11 @@ export function testNumber(): Result { }) test('parseFloat', () => { expect(parseFloat("11.20")).toEqual(11.2); + expect(parseFloat("3.14")).toEqual(3.14); + expect(parseFloat(" 3.14 ")).toEqual(3.14); + expect(parseFloat("314e-2")).toEqual(3.14); + expect(parseFloat("0.0314E+2")).toEqual(3.14); + expect(parseFloat("3.14some non-digit characters")).toEqual(3.14); }) test('isFinite', () => { -- GitLab