Floor
Round
double number = 12.44; double result = Math.Floor(number * 4) / 4;
// where "d" is your double double lowestQuarter = Math.Floor(4 * d) / 4;
12.20 -> 12 12.60 -> 12.5 11.30 -> 11.25 9.90 -> 9.75
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)