zoukankan
html css js c++ java
javascript保留两位小数
C# WEB开发基地
博客园
首页
新闻
新随笔
联系
管理
订阅
随笔- 11 文章- 78 评论- 78
javascript计算小数保留两位小数,多位小数的方法
<
SCRIPT LANGUAGE
=
"
JavaScript
"
>
<!--
function
formatFloat(src, pos)
{
return
Math.round(src
*
Math.pow(
10
, pos))
/
Math.pow(
10
, pos);
}
alert(formatFloat(
"
1212.2323
"
,
2
));
//
-->
</
SCRIPT
>
查看全文
相关阅读:
python3笔记二十二:正则表达式之函数
python3笔记二十一:时间操作datetime和calendar
python3笔记二十:时间操作time
python3笔记十七:python文件读写
Spring常用注解
Pytorch实现卷积神经网络CNN
Keras实现autoencoder
Keras实现LSTM
TensorFlow实现CNN
Recurrent Neural Networks vs LSTM
原文地址:https://www.cnblogs.com/lexus/p/1878343.html
最新文章
深入学习Redis(1):Redis内存模型
详解tomcat的连接数与线程池
详解MySQL基准测试和sysbench工具
详解Tomcat 配置文件server.xml
详解equals()方法和hashCode()方法
浅谈const char*,char* const,const char* const的区别
vs2017中Qt数据库连接
C++实现插入排序
C++实现冒泡排序
C++实现顺序表
热门文章
Qt程序异常结束,The process was ended forcefully....
vs2019清空输入缓冲区
"const char *" 类型的值不能用于初始化 "char *" 类型的实体
删除双向链表最后一个元素
airtest+poco多脚本、多设备批处理运行测试用例自动生成测试报告
python接口自动化:python3.6中import Crypto.Hash报错的解决方案
python接口自动化:pycharm中import yaml报错问题解决
python3笔记目录大纲汇总
python3笔记二十四:Mysql数据库操作命令
python3笔记二十三:正则表达式之元字符
Copyright © 2011-2022 走看看