Round Currency

Niladri.Biswas
Posted by Niladri.Biswas under C# category on | Points: 40 | Views : 713
public static double RoundCurrency(double price, int numDecimals)
{
double roundCurrency;
if (price != 0)
roundCurrency = (double)((10 ^ numDecimals) * price) / (10 ^ numDecimals);
else
roundCurrency = 0;

return roundCurrency;
}

Comments or Responses

Login to post response