What is the proper data annotation to format my decimal property?

前端 未结 1 1436
不思量自难忘°
不思量自难忘° 2020-12-11 00:22

I have a POCO with a decimal property called SizeUS. I would like to use data annotations to format the display of the decimal in a view. My SizeUS property is only displa

1条回答
  •  猫巷女王i
    2020-12-11 01:11

    [DisplayFormat(DataFormatString="{0:#.####}")]
    

    See Custom Format Strings for formats and DisplayFormatAttribute for examples

    0 讨论(0)
提交回复
热议问题