摘要: 四舍五入可以使用 toFixed() 方法,toFixed() 方法可把 Number 四舍五入为指定小数位数的数字。 代码如下: toFixed() 方法 var num =2.446242342; num = num.toFixed(2); // 输出结果为 2.45 另外像 round()、f 阅读全文
posted @ 2020-08-06 17:10 亲清 阅读(1448) 评论(0) 推荐(0) 编辑
摘要: switch case 语句 switch case 语句判断一个变量与一系列值中某个值是否相等,每个值称为一个分支。 语法 switch case 语句语法格式如下: switch(expression){ case value : //语句 break; //可选 case value : // 阅读全文
posted @ 2020-08-06 17:00 亲清 阅读(73) 评论(0) 推荐(0) 编辑
摘要: 万能在线单位转换器: http://www.zhuanhuanqi.com/danwei/danwei.html JSON在线解析及格式化验证 : https://www.json.cn/ 阅读全文
posted @ 2020-08-06 16:51 亲清 阅读(137) 评论(0) 推荐(0) 编辑
摘要: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.o 阅读全文
posted @ 2020-08-06 16:43 亲清 阅读(653) 评论(0) 推荐(0) 编辑