Link to home
Start Free TrialLog in
Avatar of MimerQ
MimerQ

asked on

Cannot implicitly convert type 'double' to 'string' (textbox.Text *= 1.25;)

In VB.NET you can write textBox.Text *= 1.25, but in C# I got this error:
Cannot implicitly convert type 'double' to 'string'

How do you multiply a textbox value with something?
Avatar of dttri
dttri
Flag of Viet Nam image

 Hello,
  To convert between for example string and double, you can use these member functions of Double class:

    public static double Parse(string)
    public override string ToString()

  Tri
ASKER CERTIFIED SOLUTION
Avatar of viola123
viola123

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of looknow12
looknow12

That one was silly, I fixed it with this.

eTotal.Text = Convert.ToString(Convert.ToDouble(Convert.ToDecimal(eKWUsage.ToString()) + Convert.ToDecimal(eRate.ToString())));

Open in new window