You can check if a decimal is an integer or not, if a decimal holds some digits other than 0 after decimal then it is not an integer while otherwise would be true
First case:
decimal d = 4848484.000000M;
if((d % 1) == 0)
{
// prints 4848484.00
Console.WriteLine(decimal.Round(d, 2, MidpointRounding.AwayFromZero));
}
else
{
Console.WriteLine(d.ToString());
}
Second case:
decimal d1 = 3456786.065343M;
if((d1 % 1) == 0)
{
Console.WriteLine(decimal.Round(d1, 2, MidpointRounding.AwayFromZero));
}
else
{
//prints 3456786.065343
Console.WriteLine(d1.ToString());
}
so if a decimal is like 3456786.065343
this will print it as it is.
and if decimal is like 4848484.000000
this will print 4848484.00