当前位置:网站首页>C# rounding MidpointRounding.AwayFromZero
C# rounding MidpointRounding.AwayFromZero
2022-08-10 02:12:00 【Wang Yuanjun】
四舍五入 在计算中 经常使用到,但是如果使用 Math.Round,just rounding up
在Math.Round内传入MidpointRounding.AwayFromZero枚举,The rounding effect can be achieved,
Debug.Log($"四舍五入{
66.6}...{
(int)Math.Round(66.6, MidpointRounding.AwayFromZero)}");
Debug.Log($"四舍五入{
66.5}...{
(int)Math.Round(66.5, MidpointRounding.AwayFromZero)}");
Debug.Log($"四舍五入{
66.4}...{
(int)Math.Round(66.4, MidpointRounding.AwayFromZero)}");
Debug.Log($"四舍五入{
66.6}...{
(int)Math.Round(66.6)}");
Debug.Log($"四舍五入{
66.5}...{
(int)Math.Round(66.5)}");
Debug.Log($"四舍五入{
66.4}...{
(int)Math.Round(66.4)}");
边栏推荐
- 生物素叠氮化物中的(CAS:1527486-16-3TAMRA-azide-PEG3-Biotin)反应的特点!
- 微信账户体系科普:什么是UnionId、OpenId与wxopenid?
- 人际关系不仅要“存”,更要“激活”!
- 破产企业的职工退休怎么办?
- egg.js中Class constructor BaseContextClass cannot be invoked without ‘new‘解决方法
- Biotin-Cy2 Conjugate,生物素-Cy2 偶联物_Cy2 生物素偶联物
- 宝塔实测-搭建LightPicture开源图床系统
- [obs] obsqsv11 hard coding and comparison with metartc codec
- D-Biotinol Involved by Biotin, CAS No: 53906-36-8 Specific Properties Description
- 【LeetCode】求根节点到叶节点数字之和
猜你喜欢
Pyscript,创建一个能执行crud操作的网页应用
有PEG-Biotin参与的(CAS:1778736-18-7)Biotin-PEG4-OH广泛用于分子靶点检测
Unity image使用长图后 图片很糊
CAS:851113-28-5 (生物素-ahx-ahx-酪胺)
Involved in PEG-Biotin (CAS: 1778736-18-7) Biotin-PEG4-OH is widely used in molecular target detection
What should I do if there is no sound after reinstalling the system in win10?
Solidity最强对手:MOVE语言及新公链崛起
Docker interview question 2--get the number of database connections and docker-compose
鲜花线上销售管理系统的设计与实现
Win7怎么把控制面板添加到右键菜单
随机推荐
Unity顶点动画
使用 GoogleTest 框架对 C 代码进行单元测试
万字总结:分布式系统的38个知识点
SonarQube升级记录:7.8->7.9->8.9
【CAS:41994-02-9 |Biotinyl tyramide】Biotinyl tyramide price
Entity FrameWork Core教程,从基础应用到原理实战
02|运算符
为什么字符串一旦创建就不可以改变?
Docker 面试题2则--取数据库连接数和docker-compose
R语言使用glm函数构建逻辑回归模型(logistic)、使用subgroupAnalysis函数进行亚组分析并可视化森林图
【LeetCode】求根节点到叶节点数字之和
破产企业的职工退休怎么办?
unity编辑器扩展界面使用 List
GB28181 sip和RTSP(Real-Time Streaming Protocol)实时流控制协议
Pyscript,创建一个能执行crud操作的网页应用
数据的存储——C语言
-采花生-
UI遍历的初步尝试
初步认识对象
无js实现弹出层效果