From d1a7d908495ced146cbfaabfd43c3b0f4f4e6ab3 Mon Sep 17 00:00:00 2001 From: duqingquan Date: Sat, 21 Sep 2024 11:38:30 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=20parseInt/parseFloat=20?= =?UTF-8?q?=E6=B5=8B=E8=AF=95=E7=A4=BA=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- uni_modules/uts-tests/utssdk/Global.uts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/uni_modules/uts-tests/utssdk/Global.uts b/uni_modules/uts-tests/utssdk/Global.uts index a4f5fd6..1c96bfc 100644 --- a/uni_modules/uts-tests/utssdk/Global.uts +++ b/uni_modules/uts-tests/utssdk/Global.uts @@ -76,7 +76,8 @@ export function testGlobal() : Result { expect(parseInt("922337203685477580700099999999999999999999999999999999999999999999999999999999999999999")).toEqualNumber(9.223372036854776e+86) expect(parseInt("50") / 100).toEqualNumber(0.5); expect(parseInt("500") / 100).toEqualNumber(5); - + expect(parseFloat("3.0").toString()).toEqual("3"); + expect(parseFloat("3.02").toString()).toEqual("3"); // #END }) @@ -90,6 +91,9 @@ export function testGlobal() : Result { expect(parseFloat("3.14some non-digit characters")).toEqual(3.14); expect(parseFloat("100") / 50).toEqualNumber(2); expect(parseFloat("105") / 50).toEqual(2.1); + + expect(parseFloat("3.0").toString()).toEqual("3"); + expect(parseFloat("3.02").toString()).toEqual("3.02"); // #END }) -- GitLab