decimal total = 0;

if(book != null && book.Price.HasValue)

{

    total = (decimal)0.01 * book.Price.Value;

}

//tip 0.01 应该使用(decimal)0.01进行转换,然后进行* 运算,这样可以成功赋值

2021.7.18 

 

posted on 2021-07-19 23:35  ♩♪♫♬  阅读(924)  评论(0)    收藏  举报