zoukankan
html css js c++ java
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
>
查看全文
相关阅读:
HDU 1251 统计难题(字典树模板题)
POJ 1182 食物链(带权并查集)
FJUT 2351 T^T的图论(并查集)
10.QT程序框架与connect
9.正则表达式
8.QList QMap QVariant
7.treeview
6.图形化列表查询显示
5.listview(QStringList QStringListModel)
4.QList
原文地址:https://www.cnblogs.com/catxp/p/388346.html
最新文章
进程注入的研究与实现
编程学习笔记 随时更新
用RegisterHotKey注册系统热键
poj3107 Godfather(鬼题畜译)
poj3107 Godfather(鬼题畜译)
poj1655 Balancing Act(树的重心[模板])
poj1655 Balancing Act(树的重心[模板])
bzoj1096 [ZJOI2007]仓库建设(斜率)
bzoj1096 [ZJOI2007]仓库建设(斜率)
bzoj1597 [Usaco2008 Mar]土地购买(斜率)
热门文章
bzoj1597 [Usaco2008 Mar]土地购买(斜率)
bzoj1010 [HNOI2008]玩具装箱toy(斜率)
bzoj1010 [HNOI2008]玩具装箱toy(斜率)
HDU 5510 Bazinga(KMP)
HDU 5918 Sequence I (KMP)
POJ 3581 Sequence (后缀数组+离散化)
HDU2846 Repository(字典树)
HDU 1075 What Are You Talking About(map或字典树)
HDU 1247 Hat’s Words(字典树)
字典树模板
Copyright © 2011-2022 走看看