int sqrft = 1335;
decimal pricePerSqr = 18.33m;
decimal pricePerYear = Math.Round(pricePerSqr * sqrft, 2,
MidpointRounding.AwayFromZero);
decimal pricePerMonth = Math.Round(pricePerYear / 12, 2,
MidpointRounding.AwayFromZero);
Console.WriteLine("/Sqr:"+pricePerSqr.ToString());
Console.WriteLine("/Year:"+pricePerYear.ToString());
Console.WriteLine("/Mth:"+pricePerMonth.ToString());
// Find PricePerSqr given PerMonth.
pricePerMonth = 2039.21m;
pricePerYear = pricePerMonth * 12;
pricePerSqr = Math.Round(pricePerYear / sqrft, 2,
MidpointRounding.AwayFromZero);
Console.WriteLine("-----------");
Console.WriteLine("/Sqr:"+pricePerSqr.ToString());
Console.WriteLine("/Year:"+pricePerYear.ToString());
Console.WriteLine("/Mth:"+pricePerMonth.ToString());
/Sqr:18.33
/Year:24470.55
/Mth:2039.21
-----------
/Sqr:18.33
/Year:24470.52
/Mth:2039.21
Should I be doing something different to make both ways add up the same.
Notice the Year price is slightly different when backing in from
pricePerMonth. TIA
--
William Stacey [MVP]