![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
前端实用js
fightWz
这个作者很懒,什么都没留下…
展开
-
时间戳转化为年月日时分秒
/** * 时间戳转化为年 月 日 时 分 秒 * @param {*} number 传入时间戳 * @param {*} format 返回格式,支持自定义,但参数必须与formateArr里保持一致 * @returns */export const formatTime =(number, format) => { let formateArr = ['Y', 'M'...原创 2018-11-16 11:35:04 · 2178 阅读 · 0 评论 -
数字(金钱格式)相互转化
/** * 数字格式化金钱展示 * @param {*} num 串数字 * @returns */export const numFormat = (num) => { if (typeof (num) != 'number') { num = Number(num) } num = num.toFixed(2); num = parseFloat(num...原创 2018-11-16 11:50:12 · 1931 阅读 · 0 评论 -
字符串全部替换
/** * 全部替换 * @param {*} textString 需要替换字符串 * @param {*} f 需要替换值 * @param {*} e 替换后的的值 * @returns */export const myReplace= (textString, f, e) => { let reg=new RegExp(f, "g"); //创建正则RegExp对...原创 2018-11-16 11:54:04 · 921 阅读 · 0 评论