Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
かみそりスクリプト MVC 3 で小数を小数点以下の整数に変換する
300.00 から 300 および 39.09 を 39.09 のように
Model.Blahビューで使用されるモデルのプロパティであると仮定Decimalします。
Model.Blah
Decimal
if (Convert.ToInt32(Model.Blah) == Model.Blah) { <p>@Model.Blah.ToString("N0")</p> } else { <p>@Model.Blah.ToString("N2")</p> }