javascript的取整函数
当前位置:点晴教程→知识管理交流
→『 技术文档交流 』
[code]<script language=javascript>
var t=3.1415; alert( "int("+t+") = "+int(t) ); alert( "parseInt("+t+") = "+parseInt(t) ); alert( "Math.floor("+t+") = " +Math.floor(t) ); alert( "Math.round("+t+") = "+Math.round(t) ); alert( "Math.ceil("+t+") = " +Math.ceil(t) ); function int(num){return num-num%1} </script>[/code] 该文章在 2011/6/15 11:17:28 编辑过 |
关键字查询
相关文章
正在查询... |