How to display values only upto 2 decimal places

后端 未结 8 2292
南旧
南旧 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:49

    Format in presentation layer:

    string.Format("{0:#.##}", value);
    
    0 讨论(0)
  • 2020-12-17 19:53

    test this code:

    value.ToString("F2");
    
    0 讨论(0)
提交回复
热议问题