I am under s situation where i find modulo of 2.0 %0.1 which as result of double variable returns "0.09999" not "0".
My code to do this is:
var distanceFactor = slider.Value % step; //This do not return 0 when Value=2.0 and step=0.1
if (distanceFactor != 0)
{
slider.Value -= distanceFactor;
}
elseif(distanceFactor == 0)
{
//do something here
}
txtblUnits.Text = Math.Round(slider.Value, 1).ToString();
How to obtain the control in elseif
condition when Value=2.0 and step=0.1 ?