提交 3715ae94 编写于 作者: 杜庆泉's avatar 杜庆泉

number.fixed 增加部分测试用例

上级 2dc3393f
...@@ -279,6 +279,19 @@ export function testJSON() : Result { ...@@ -279,6 +279,19 @@ export function testJSON() : Result {
console.log(retStr) console.log(retStr)
}) })
test('UTSJSONOject', () => {
//var t1 = "1"
//const a = {
// test(){
// t1 = "2"
// console.log("test")
// }
//}
//(a['test'] as ()=>void)()
//console.log(a['test'])
//expect(t1).toEqual("2")
})
}) })
......
...@@ -38,6 +38,21 @@ export function testNumber(): Result { ...@@ -38,6 +38,21 @@ export function testNumber(): Result {
expect(a2.toShort().toFixed(5)).toEqual("-122.00000"); expect(a2.toShort().toFixed(5)).toEqual("-122.00000");
// #endif // #endif
/**
* add since 2023-11-21
* 发现部分场景在android 6 以下与web有差异,新增以下示例
*/
let r = 2.449999999999999999;
let t1 = r.toFixed(1);
expect(t1).toEqual("2.5");
let r2 = 2.4499999999999999;
let t2 = r2.toFixed(1);
expect(t2).toEqual("2.4");
let r3 = -9007199254740991;
let t3 = r3.toFixed(15);
expect(t3).toEqual("-9007199254740991.000000000000000");
}) })
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册