jQuery圆函数 [英] jQuery round function
本文介绍了jQuery圆函数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何使用jQuery对数字进行舍入?
How can I round the number using jQuery?
如果数字是3168,我想将其打印为32.
或者如果数字是5233结果应为52。
If the number is 3168 I want to print it as 32. Or if the number is 5233 the result should be 52.
我该怎么做?
我应该使用 Math.round
函数吗?
How can I do that?
Should I use the Math.round
function?
推荐答案
是的,您应该使用Math.round(除以100之后)。
Yes, you should use Math.round (after dividing by 100).
jQuery是一个用于DOM遍历,事件处理和基于JavaScript构建的动画的库。它不会取代JavaScript,也不会重新实现其所有基本功能。
jQuery is a library for DOM traversal, event handling and animation built on top of JavaScript. It doesn't replace JavaScript and doesn't reimplement all its basic functions.
这篇关于jQuery圆函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文