Out write rate into a string - Operator '/' cannot be applied to operands of type 'string' and** > 'double'

后端 未结 2 356
野性不改
野性不改 2021-01-28 22:39

it is such that I must have written price in a string to be displayed to users.

right now will give this error is

Operator \'/\' cannot be

2条回答
  •  别那么骄傲
    2021-01-28 23:28

    As far as I can tell you, prisenMedlemskab is a string and not an integer You have to parse it.

    e.g.

    double prisenMedlemskabDouble = double.Parse(prisenMedlemskab);
    

    And then do

    ButtonPay.Text = "Buy Membership - DKK " + (prisenMedlemskabDouble / moms).ToString("F2") + ",- Kr";
    

提交回复
热议问题