随笔分类 -  c#

上一页 1 2
18.(c#)如何解决CheckBoxList数据源为空时,控件无法使用前端javascript,jQuery .append()方法添加动态加载项
摘要:if(list.Count == 0) { list .Add(new bookDetail { Code =""; Name ="" }); } checkboxList.Source = list ; //添加一个空值项,可以使得控件有值,可以被引用 阅读全文
posted @ 2021-07-20 23:28 ♩♪♫♬ 阅读(84) 评论(0) 推荐(0)
17.(c#)如何自动过滤掉xxx0.000以零结尾的数字,并且自动保留非0小数位
摘要:var title = book.Price.ToString("#0.##"); //使用.ToString方法分别传入#数字位,和0占位符 阅读全文
posted @ 2021-07-20 22:45 ♩♪♫♬ 阅读(162) 评论(0) 推荐(0)
9.(c#)decimal 类型的数值如何和小数相乘并且返回decimal类型
摘要:decimal total = 0; if(book != null && book.Price.HasValue) { total = (decimal)0.01 * book.Price.Value; } //tip 0.01 应该使用(decimal)0.01进行转换,然后进行* 运算,这样可 阅读全文
posted @ 2021-07-19 23:35 ♩♪♫♬ 阅读(931) 评论(0) 推荐(0)

上一页 1 2