First of all sorry for my english, I need a function (it can be from Math library) to truncate a decimal (not int) number.
Lets say I have a value of 4.8671 and want first 4 digit as 4.867, Lets say I have a value of 244.123456 and want first 5 digit as 244.12, how can I truncate it without rounding up?
I have tried the following but both of them give me different numbers
void Main()
{
Console.Write(Math.Round(4.8671, 2,MidpointRounding.ToEven));
Console.Write(Math.Round(4.8671, 2));
}
Almost all functions are rounding (2.987654) to (2.99) or floor (2). These numbers are error reason on my project.
It has to be effective way.
Is there a function for it, if there is not how can i implement ?