当前位置:网站首页>JS how to get integer
JS how to get integer
2022-07-02 19:42:00 【Full stack programmer webmaster】
Hello everyone , I meet you again , I'm your friend, Quan Jun .
1. Discard the fraction , Keep the integer part parseInt(5/2)
2. Rounding up , If there is a decimal, add... To the whole part 1
Math.ceil(5/2)
3, rounding .
Math.round(5/2)
4, Rounding down
Math.floor(5/2)
Publisher : Full stack programmer stack length , Reprint please indicate the source :https://javaforall.cn/148577.html Link to the original text :https://javaforall.cn
边栏推荐
- Py's interpret: a detailed introduction to interpret, installation, and case application
- 嵌入式(PLD) 系列,EPF10K50RC240-3N 可编程逻辑器件
- How to set priorities in C language? Elaborate on C language priorities
- Watchful pioneer world outlook Architecture - (how does a good game come from)
- 452-strcpy、strcat、strcmp、strstr、strchr的实现
- pxe装机「建议收藏」
- MySQL表历史数据清理总结
- Codeworks round 802 (Div. 2) pure supplementary questions
- 基于SSM实现网上购物商城系统
- Gmapping code analysis [easy to understand]
猜你喜欢

Common problems and description of kt148a voice chip IC development

Build a master-slave mode cluster redis

zabbix5客户端安装和配置

编写完10万行代码,我发了篇长文吐槽Rust

自動生成VGG圖像注釋文件

Refactoring: improving the design of existing code (Part 2)

Data dimensionality reduction principal component analysis

xml开发方式下AutowiredAnnotationBeanPostProcessor的注册时机

How to avoid duplicate data in gaobingfa?

Windows2008R2 安装 PHP7.4.30 必须 LocalSystem 启动应用程序池 不然500错误 FastCGI 进程意外退出
随机推荐
[error record] problems related to the installation of the shuttle environment (follow-up error handling after executing the shuttle doctor command)
Getting started with typescript
End to end object detection with transformers (Detr) paper reading and understanding
《MongoDB入门教程》第03篇 MongoDB基本概念
Golang:[]byte to string
Cuckoo filter
AcWing 903. Expensive bride price solution (the shortest path - building map, Dijkstra)
Solution: vs2017 cannot open the source file stdio h main. H header document [easy to understand]
AcWing 383. 观光 题解(最短路)
451-memcpy、memmove、memset的实现
Implementation of 453 ATOI function
pxe装机「建议收藏」
Windows2008r2 installing php7.4.30 requires localsystem to start the application pool, otherwise 500 error fastcgi process exits unexpectedly
452-strcpy、strcat、strcmp、strstr、strchr的实现
Web2.0 giants have deployed VC, and tiger Dao VC may become a shortcut to Web3
函数高阶-柯里化实现
MySQL
From 20s to 500ms, I used these three methods
Quanzhi A33 uses mainline u-boot
AcWing 1125. Cattle travel problem solution (shortest path, diameter)