zoukankan
html css js c++ java
js截取小数点后几位的写法
截取小数点后几位的方法有很多,下面为大家介绍下使用js是如何实现的
如果${showInfo.tt}的值为20,要要它除以10以后精确到小数点后2位,那么js代码中可作如下写法:
复制代码 代码如下:
//by www.jbxue.com
var a = ${showInfo.tt}/10;
//alert(a.toFixed(3)); //表示到小数点后3位得出的值为2.000
document.write(a.toFixed(2)); //得出的值为2.00
查看全文
相关阅读:
Java基础__ToString()方法
wamp的www目录更改为指定目录
织梦Dedecms主要文件夹目录及模板文件说明
下拉菜单
替换代码行之间空白
CSS 之 Opacity多浏览器透明度兼容处理
网页字体特效代码
jquery animate 动画效果使用说明
CSS中属性position位置详解功能讲解与实例分析
jQuery通过jquery.form.js插件使用AJAX提交Form表单
原文地址:https://www.cnblogs.com/linuxnotes/p/3424607.html
最新文章
sell -- 解码16进制unicode
java 中间件
node——将用户提交的数据写入data.json文件
node——进阶版服务器根据不同请求作出不同响应+响应html文件等文件
node——npm
node——request和response的常用对象
jq——事件
jq——动画
jq——DOM文档处理
jq——html,text,val和对象访问
热门文章
jq——css类
jq——属性和方法
【spoj2774】最长公共子串
【bzoj3223】Tyvj 1729 文艺平衡树
Codeforces Round #345 (Div 2)
【弃】填坑计划【1】(2016.03.06)
PHP 二维数组根据某个字段排序
Java GUI小程序--画板
Android_activity实现一个简单的新建联系表
Java基础__Integer类型中的自动装箱
Copyright © 2011-2022 走看看