js
苏紫紫
杀一个程序员不需要用枪,改三次需求就可以了
展开
-
将数字0-9转为中文大写数字
//转为中文大写数字var n = 230var fraction = ["角", "分"];var digit = ["零", "壹", "贰", "叁", "肆", "伍", "陆", "柒", "捌", "玖"];var unit = [["元&转载 2018-11-01 10:53:08 · 2780 阅读 · 0 评论 -
保留两位小数点,保留2位小数,如:2,会在2后面补上00.即2.00
function toDecimal2(x) { var f = parseFloat(x); if (isNaN(f)) { return false; } var f = Math.round(x*100)/100; var s = f.toString(); var rs = s.inde...转载 2018-11-01 11:00:14 · 1160 阅读 · 0 评论 -
Socket,Websocket,推送信息
使用方法import createSocket from "./socket"; createSocket({ key: `1_${orderNumber}`, //key值 host: __path+'/', //访问网址 onmessage(data) { console.log("push", data)...转载 2018-11-14 13:17:41 · 173 阅读 · 0 评论