How to display values only upto 2 decimal places

后端 未结 8 2395
南旧
南旧 2020-12-17 19:04

I have a table column \"Amount\" of type money. When I am retrieving its value through a store procedure, it returns the value upto 4 decimal places(because of type money).

8条回答
  •  长情又很酷
    2020-12-17 19:41

    You can use Standard Numeric Format Example:

    decimal dValue = 1.268;
    string sValue = dValue.ToString("N"); // 1.27
    

提交回复
热议问题