The code below somewhat works but not rounding correctly, my goal is if a value = 1.5 round down, if 1.51 round up.
Thanks
if (!String.IsNullOrEmpty(tbSnp_Uld.Text) && !string.IsNullOrEmpty(cbSnp_Uld.Text))
{
double d_tbSnp_Uld = Convert.ToDouble(tbSnp_Uld.Text);
double d_cbSnp_Uld = Convert.ToDouble(cbSnp_Uld.Text);
double result1 = Math.Ceiling(d_tbSnp_Uld / d_cbSnp_Uld);
double d = 0;
int floored = (int)Math.Floor(d);
int ceiled = (int)Math.Ceiling(d);
double epsilon = 0;
int lessThan = floored - Convert.ToInt32(Math.Abs(d - floored) < epsilon);
int moreThan = ceiled + Convert.ToInt32(Math.Abs(d - ceiled) < epsilon);
tbTrailer_Needed.Text = result1.ToString();
}