当前位置:网站首页>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
边栏推荐
- 从20s优化到500ms,我用了这三招
- checklistbox控件用法总结
- KT148A语音芯片ic的用户端自己更换语音的方法,上位机
- 自動生成VGG圖像注釋文件
- AcWing 1135. 新年好 题解(最短路+搜索)
- AcWing 383. Sightseeing problem solution (shortest circuit)
- Digital scroll strip animation
- AcWing 1127. 香甜的黄油 题解(最短路—spfa)
- zabbix5客户端安装和配置
- Watchful pioneer world outlook Architecture - (how does a good game come from)
猜你喜欢
《架构整洁之道》读书笔记(下)
AcWing 340. 通信线路 题解(二分+双端队列BFS求最短路)
KT148A语音芯片使用说明、硬件、以及协议、以及常见问题,和参考代码
定了,就是它!
嵌入式(PLD) 系列,EPF10K50RC240-3N 可编程逻辑器件
Set up sentinel mode. Reids and redis leave the sentinel cluster from the node
How to avoid duplicate data in gaobingfa?
字典
RPD出品:Superpower Squad 保姆级攻略
Idea editor removes SQL statement background color SQL statement warning no data sources are configured to run this SQL And SQL dialect is not config
随机推荐
《重构:改善既有代码的设计》读书笔记(上)
AcWing 1128. 信使 题解(最短路—Floyd)
IDEA编辑器去掉sql语句背景颜色SQL语句警告No data sources are configured to run this SQL...和SQL Dialect is Not Config
Chapter 7 - class foundation
AcWing 341. 最优贸易 题解 (最短路、dp)
AcWing 1134. 最短路计数 题解(最短路)
Digital scroll strip animation
AcWing 383. 观光 题解(最短路)
AcWing 1137. 选择最佳线路 题解(最短路)
Golang并发编程——goroutine、channel、sync
Data dimensionality reduction factor analysis
Introduction to program ape (XII) -- data storage
Which video recording software is better for the computer
AcWing 1128. Messenger solution (shortest path Floyd)
How to avoid duplicate data in gaobingfa?
R语言使用econocharts包创建微观经济或宏观经济图、indifference函数可视化无差异曲线(indifference curve)
Horizontal ultra vires and vertical ultra vires [easy to understand]
Postman下载安装
Refactoring: improving the design of existing code (Part 2)
How to set priorities in C language? Elaborate on C language priorities