var rounded = Math.round( number * 10 ) / 10;   // round to one digit
var rounded = Math.round( number * 100 ) / 100; // round to two digit
function round(value, precision) {
var multiplier = Math.pow(10, precision || 0);
return Math.round(value * multiplier) / multiplier;
} var fixed = rounded.toFixed(1); // round to one digit
var fixed = rounded.toFixed(2); // round to two digit
 

最新文章

  1. C# OracleDBhelper
  2. 利用Angularjs测试引擎Karma进行自动化单元测试
  3. 【leetcode】Remove Duplicates from Sorted Array I & II(middle)
  4. php计算几分钟前、几小时前等
  5. php curl的使用
  6. 一些判断Linux是否被黑的经验
  7. [转载]word尾注插入参考文献——前人经验+自己总结
  8. 【SPOJ】Transposing is even more fun!
  9. 判断webpart类型 How can I tell what type a web part is?
  10. const char*、char*、char* const、char[]、string的区别
  11. python基础补充
  12. ViewData ViewBag ViewModel
  13. protobuf-net-data
  14. SQL 创建分区表
  15. MySQL 导入导出数据库、表
  16. 网络原因导致的 spring cloud config 读取git上的配置文件时报错:Cannot clone or checkout repository
  17. springmvc 在非controller下使用@autowired
  18. 用XMLHttpRequest制作一个简易ajax
  19. 记账本微信小程序开发五
  20. delphi字符串分割

热门文章

  1. hive表分区相关操作
  2. Game-Based Learning Is Changing How We Teach. Here's Why.
  3. react native开源库管理
  4. NYOJ469 - 擅长排列的小明 II - (dp)
  5. docker 空间清理
  6. 小程序SetData
  7. luogu P1550 [USACO08OCT]打井Watering Hole
  8. JAVA基础--MySQL(二)
  9. 垃圾邮件分类实战(SVM)
  10. WDM驱动改可手动加卸载的NT驱动