double variable = Convert.ToDouble(5/100);
Will return 0.0 but i expected 0.05
What can / must i change to get 0.05
because the 5 in this example is a variable
double variable = Convert.ToDouble(5/100);
Will return 0.0 but i expected 0.05
What can / must i change to get 0.05
because the 5 in this example is a variable
Because 5/100 in integer division is 0. You need to ensure you are doing division on doubles.