Possible Duplicate:
c# - How do I round a decimal value to 2 decimal places (for output on a page)
I have an XML file with decimal values of temperature in string format. Examples:
<temp>30</temp>
<temp>40.6</temp>
I retrieve the temperature using LINQ like this
temperature = d.Element("temp").Value
How do I revise this code so that the value is rounded up or down appropriately before assigning to temperature in string format. This means, in the first example, temperature will be "30" and in the 2nd example, temperature will be "41". Thanks.