value.toFixed is not a function
来源:互联网 发布:中国输电网络先进吗 编辑:程序博客网 时间:2024/05/29 18:37
事件是这样的
是一个图表页面,请求了接口后,因为有的数据有 1.2555555555 很长一段,所以要做保留两位小数,然后用了
var a = data.xx.toFixed(2)
data.xx = a;
出现了 value.toFixed is not a function
是因为拿了转化后的数据去相加,然后再用 toFixed(2)保留两小时
注意 : 用了.toFixed(2) ,这时候的 a 已经变成的字符串 , typeof a 得出来的是 string ,得用 parseFloat(a) 转回 数字类型
阅读全文
0 0
- value.toFixed is not a function
- toFixed() is not a function
- num.toFixed is not a function(js报错)
- 使用toFixed()函数时,出现“toFixed() is not a function”的解决办法
- intermediate value is not a function报错解决方法
- js 报错(intermediate value)(...) is not a function
- js运行报错:(intermediate value) is not a function
- chart.js(intermediate value).Line is not a function
- $ is not a function
- $ is not a function
- is not a function
- $(...).niceScroll is not a function; $... is not a function
- object is not a function
- RVM is not a function
- $(...).scrollpic is not a function
- javascript *** is not a function
- $(...).live is not a function
- $(...).niceScroll is not a function
- GridView排序
- osg动态修改坐标
- h5 选择结构 调试 switch
- (笔记)为何boost中boost::shared_ptr 循环引用会导致引用计数机制失效
- Hadoop实战(9)_Hive进阶及UDF开发
- value.toFixed is not a function
- Chrome浏览器快捷键
- 变量加载顺序
- [Unity][C#][File]File无法新建文件UnauthorizedAccessException,File.Create is denied的解决办法
- Android进阶(二)--序列化Serializable和Parcelabel使用与区别
- spring-cloud【eureka】
- js 读取excel
- 解读:大数据在电信行业的五大应用
- [leetcode]#27. Remove Element