Quantcast
Channel: ASP.NET Core
Viewing all articles
Browse latest Browse all 9386

Razor Syntax for Division of 2 values

$
0
0

Hello:

Having trouble performing simple division on 2 values in Razor on a view:

Trying to divide a @Model.Sum with @Model.Count:

 @(@Model.Sum(i => i.MTDTotalSalesRollup)/@Model.Count())

I am getting a Attempted to divide by zero. I am able to get valid values for @Model.Sum(i => i.MTDTotalSalesRollup) and @Model.Count()

Any ideas? Thanks.


Viewing all articles
Browse latest Browse all 9386

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>