We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
一、取整 1,直接取整(丢弃小数部分)
var num = parseInt(5/3); // 1
2,四舍五入取整
var num = Math.round(5/3); // 2
3,向上取整
var num = Math.ceil(5/3); // 2
4,向下取整
var num = Math.floor(5/3); // 1
保留小数点后N位
The text was updated successfully, but these errors were encountered:
No branches or pull requests
一、取整
1,直接取整(丢弃小数部分)
2,四舍五入取整
3,向上取整
4,向下取整
参考连接
保留小数点后N位
The text was updated successfully, but these errors were encountered: