C# Currency to string

后端 未结 10 2815
旧巷少年郎
旧巷少年郎 2021-02-19 10:52

I am querying a database field that returns a money value, I am assigning this to a string but it is adding extra 00 on the end.

e.g. Query returns 30.00

10条回答
  •  你的背包
    2021-02-19 11:33

    I am currently developing a boatdock web system, using VS 2013 Community edition. I was trying to work out how to output a currency value into a textbox.

    The method that I used was

    fieldName.Text = decimalValue.ToString("c");

    It works perfectly.

提交回复
热议问题