Skip to content

Latest commit

 

History

History
18 lines (12 loc) · 273 Bytes

number.md

File metadata and controls

18 lines (12 loc) · 273 Bytes

Number

数字类型相关

addNums

浮点数精准相加, 支持同单位数相加

  • @param num1 {number, string}
  • @param num2 {number, string}
  • @return {number}
0.1 + 0.2 > 0.3; // true

addNums(0.1, 0.2); // 0.3
addNums('12%', '20%'); // 32%