Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is fix equivalent function in c#

Tags:

c#

asp.net-mvc

I am using Mvc framework and i want to migrate vb code to c#. Right now i want to use** FIX ** function equivalent in c#

Example:- Vb Code

result.ReducedDegrees= Fix(dblReducedAngle)    
result.ReducedMinutes = Fix((dblReducedAngle - Fix(dblReducedAngle)) * 60)

I want to get result in c#

like image 458
Naveen Avatar asked Mar 30 '16 06:03

Naveen


1 Answers

The Fix function removes the fractional part of a numeric expression. Closely the same functionality as Int, except the Fix method has a special clause at the bottom:

If Number is negative, Fix returns the first negative integer greater than or equal to Number.

In C#, there is the Math.Truncate method which you can use. It has the same properties as VB's Fix method.

like image 52
Wazner Avatar answered Nov 15 '22 11:11

Wazner