Relative Content

Tag Archive for crounding

Round to 1 decimal place and should be double return type

if(cartWeight >= 10) { totalPrice = 100; double price = totalPrice – (totalPrice * 18.00 / 100); decimal val = Convert.ToDecimal(string.Format(“{0:F1}”, price)); price = decimal.ToDouble(val); return price; } Method Return type shouble be strictly double type and this method should always return 82.0 as double value not decimal. In the above code val is 82.0 […]

Round to 1 decimal place and should be double return type

if(cartWeight >= 10) { totalPrice = 100; double price = totalPrice – (totalPrice * 18.00 / 100); decimal val = Convert.ToDecimal(string.Format(“{0:F1}”, price)); price = decimal.ToDouble(val); return price; } Method Return type shouble be strictly double type and this method should always return 82.0 as double value not decimal. In the above code val is 82.0 […]

Round to 1 decimal place and should be double return type

if(cartWeight >= 10) { totalPrice = 100; double price = totalPrice – (totalPrice * 18.00 / 100); decimal val = Convert.ToDecimal(string.Format(“{0:F1}”, price)); price = decimal.ToDouble(val); return price; } Method Return type shouble be strictly double type and this method should always return 82.0 as double value not decimal. In the above code val is 82.0 […]