Peter Kiers
asked on
Converting problem in a methode.
Dear Experts,
I programm in VS2010 and I use C#. I have this code but it has an error.
I have marked the codeline with an arrow that has the error :
Error:
"Cannot implicitly convert type 'double' to 'decimal'. An explicit conversion exists (are you missing a cast?)".
How can I solve this?
Greetings,
Peter Kiers
I programm in VS2010 and I use C#. I have this code but it has an error.
I have marked the codeline with an arrow that has the error :
private void btnSwUnit_Click(object sender, EventArgs e)
{
Properties.Settings.Default.IsMGDL = !Properties.Settings.Default.IsMGDL;
Properties.Settings.Default.Save();
if (Properties.Settings.Default.IsMGDL)
{
btnSwUnit.Text = "Switch to mmol/l";
lblSwUnit.Text = "Glucose Units: mg/dl";
int eValInt = Convert.ToInt32(spdMinVal.Value) / 18;
spdMinVal.Value = eValInt;
}
else
{
btnSwUnit.Text = "Switch to mg/dl";
lblSwUnit.Text = "Glucose Units: mmol/l";
double eValue = Convert.ToDouble(spdMinVal.Value) * 18;
spdMinVal.Value = eValue; <==========
}
}
Error:
"Cannot implicitly convert type 'double' to 'decimal'. An explicit conversion exists (are you missing a cast?)".
How can I solve this?
Greetings,
Peter Kiers
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER