• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2284
  • Last Modified:

Truncating a decimal

It seems that C# wants to round everything. I need to truncate a number instead.

i.e.   5.9 = 5, not 6

Is there a way to do this in C# without converting my number to a string, searching for the decimal and manipulating the string and converting back to a number?
1 Solution
look at the Ceiling() and Floor() functions.

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now