I'm using Decimal
s in VB.NET to hold values for currency. It is possible on my website to add a discount to an item, which is inputted into a text box and then the value is retrieved in the code-behind.
Dim discountValue As Decimal = 0
discountValue = Decimal.Round(Convert.ToDecimal(txtDiscount.Text), 2)
lblDiscount.Text = "£" & discountValue.ToString()
However, when I view the label after adding the discount, it is not rounded to 2 decimal points.
Is there any reason this is not working? What am I doing wrong in this approach?
Note: I'm using ASP.NET VB.NET and the page is wrapped inside an UpdatePanel.