当前位置:网站首页>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
边栏推荐
- IDEA编辑器去掉sql语句背景颜色SQL语句警告No data sources are configured to run this SQL...和SQL Dialect is Not Config
- AcWing 1134. 最短路计数 题解(最短路)
- AcWing 343. 排序 题解(floyd性质实现传递闭包)
- 2022.7.1-----leetcode. two hundred and forty-one
- AcWing 1128. Messenger solution (shortest path Floyd)
- A4988 drive stepper motor "recommended collection"
- Codeworks round 802 (Div. 2) pure supplementary questions
- Function high order curry realization
- Use cheat engine to modify money, life and stars in Kingdom rush
- AcWing 1126. Minimum cost solution (shortest path Dijkstra)
猜你喜欢
搭建哨兵模式reids、redis从节点脱离哨兵集群
蓝牙芯片ble是什么,以及该如何选型,后续技术发展的路径是什么
自動生成VGG圖像注釋文件
Kt148a voice chip IC software reference code c language, first-line serial port
zabbix5客户端安装和配置
数据湖(十二):Spark3.1.2与Iceberg0.12.1整合
《架构整洁之道》读书笔记(下)
冒泡排序数组
AcWing 903. Expensive bride price solution (the shortest path - building map, Dijkstra)
ShardingSphere-JDBC5.1.2版本关于SELECT LAST_INSERT_ID()本人发现还是存在路由问题
随机推荐
[ERP software] what are the dangers of the secondary development of ERP system?
Génération automatique de fichiers d'annotation d'images vgg
What is the MySQL backup suffix_ MySQL backup restore
zabbix5客户端安装和配置
Use cheat engine to modify money, life and stars in Kingdom rush
AcWing 342. Road and route problem solving (shortest path, topological sorting)
Pytorch版本、CUDA版本与显卡驱动版本的对应关系
Think about the huge changes caused by variables
高并发下如何避免产生重复数据?
AcWing 1125. 牛的旅行 题解(最短路、直径)
Notes de lecture sur le code propre
Registration opportunity of autowiredannotationbeanpostprocessor in XML development mode
AcWing 1131. 拯救大兵瑞恩 题解(最短路)
嵌入式(PLD) 系列,EPF10K50RC240-3N 可编程逻辑器件
Introduction to mongodb chapter 03 basic concepts of mongodb
AcWing 903. Expensive bride price solution (the shortest path - building map, Dijkstra)
[pytorch learning notes] tensor
Registration opportunity of autowiredannotationbeanpostprocessor under annotation development mode
4274. 后缀表达式-二叉表达式树
Npoi export Excel2007