第一种:select convert(varchar,cast(_money AS MONEY),1) AS _money -----带小数点的第二种: select reverse(stuff(reverse(convert(varchar,convert(money,123000),1)),1,3,'')) ----不带小数点的
JS实现转换千分位计数 350000.00-------350,000.00 var num=0;function format (num) { return (num.toFixed(2) + '').replace(/\d{1,3}(?=(\d{3})+(\.\d*)?$)/g, '$&,');} var num = 12345;console.log(format(num));-----------------输出12,345.00 js方法toFixed(n):将number转换为小数点
JS 添加千分位,测试可以使用 <script language="javascript" type="text/javascript">function comdify(n){ var re=/\d{1,3}(?=(\d{3})+$)/g; var n1=n.replace(/^(\d+)((\.\d+)?)$/,function(s,s1,s2){return s1.replace(re,"$&,")+s2;}); ret