Skip to content

Commit

Permalink
add: index.d.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
Yangfan2016 committed Dec 29, 2018
1 parent 956bc20 commit 8512d91
Show file tree
Hide file tree
Showing 5 changed files with 66 additions and 18 deletions.
6 changes: 3 additions & 3 deletions dist/yan.esm.js
Original file line number Diff line number Diff line change
Expand Up @@ -230,18 +230,18 @@ function toBase64(str) {
if (_isUndef(window.btoa)) {
_throwError("window.btoa is not defined");
}
return window.btoa(window.encodeURIComponent(str));
return btoa(encodeURIComponent(str));
}
// decode base64
function fromBase64(str) {
if (_isUndef(window.atob)) {
_throwError("window.atob is not defined");
}
return window.decodeURIComponent(window.atob(str));
return decodeURIComponent(atob(str));
}
// 千分位转换法 123456->123,456
function toThousands(num) {
if (num.length < 3)
if (("" + num).length < 3)
return num.toString();
var res = num.toLocaleString("en-US");
if (/(,\d{3})+/.test(res)) { // 方案1
Expand Down

0 comments on commit 8512d91

Please sign in to comment.