工作小结(二十二)-数字千分位显示

1.sql server中怎样对数字进行千分位编辑?

select   convert(varchar,convert(money,123000),1)    结果:123,000.00
    
--去掉小数位  
  select   reverse(stuff(reverse(convert(varchar,convert(money,123000),1)),1,3,''))    结果:123,000 

 

2.GridView显示时控制

设置:DataFormatString="{0:N}"

注:数据库中金额最好是Decimal,若为String则失效无用。

你可能感兴趣的:(千分位)