如何删除数字的小数
- Previous page Tree view
- Next page Remove attribute
学习如何在 JavaScript 中删除数字的小数部分。
删除小数
您可以使用 Math.trunc()
方法删除数字中的小数:
实例
let x = Math.trunc(8.7512356); // 8
相关页面
- Previous page Tree view
- Next page Remove attribute
学习如何在 JavaScript 中删除数字的小数部分。
您可以使用 Math.trunc()
方法删除数字中的小数:
let x = Math.trunc(8.7512356); // 8
The content provided by CodeW3C.com is for training and testing purposes only and does not guarantee the accuracy of the content. Risks associated with the use of this site's content are not related to this site. All rights reserved.
About CodeW3C.com
Help CodeW3C.com
Terms of use
Privacy terms