我正在使用 Mvc 框架,我想将 vb 代码迁移到 c#。现在我想在 C# 中使用 ** FIX ** 等效函数
示例:- Vb 代码
result.ReducedDegrees= Fix(dblReducedAngle)
result.ReducedMinutes = Fix((dblReducedAngle - Fix(dblReducedAngle)) * 60)
我想在c#中得到结果
最佳答案
Fix函数删除数值表达式的小数部分。与 Int 的功能几乎相同,除了 Fix 方法在底部有一个特殊的子句:
If Number is negative, Fix returns the first negative integer greater than or equal to Number.
在 C# 中,有 Math.Truncate您可以使用的方法。它具有与 VB 的 Fix 方法相同的属性。
关于c# - c#中的修复等价函数是什么,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36301469/