公司同事问我有没有遇到过decimal类型数据入库时,会自动取整的问题(比如12.3入库后值是12,12.8入库后值是13,入库后自动四舍五入自动取整): 之前就遇到过从数据去decimal类型数据时,会自动取整的问题:我想应该是同样的问题吧,叫同事设置SQLParameter参数时,设置Scale=2,Precision=18:类似代码如下: var param1 = new SqlParameter("@Money",System.Data.SqlDbType.Decimal);
function getFormatYMD(timesamp){ var date = new Date(timesamp); Y = date.getFullYear() + '-'; M = (date.getMonth()+1 < 10 ? '0'+(date.getMonth()+1) : date.getMonth()+1) + '-'; D = date.getDate(); D= D.toString().length==1 ? '0'+D:D; return Y+M+D;} 这个
原文地址:http://www.jb51.net/article/60177.htm using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace Test { class Program { static void Main(string[] args) { DateTime t1 = DateTime.Parse("2007-01-01"); DateT