I\'m not a Math person so I\'m having a hard time to come up with a calculation to round the decimals to 25, 50, 75 and 100. And this will not be the typical round off because t
My code may not be the best out there, but it will work. In your function create a float and an int like so.
public float RoundNearestCents(String price)
{
float srp = float.Parse(price);
int srp1 = Int32.Parse(price);
if((srp-srp1)>=0.5)
srp1++;
else
return srp1;
return srp1;
}
The int would truncate out the decimal part, which is like flooring the price.