This is my code
Dim dblPrice As Double = 0
Dim dblTotal As Double = 0
Dim strTotal As String
dblPrice = CDbl(txtPrice.Text)
intQuantity = CInt(txtQuantity.Text)
dblTotal = (dblPrice * intQuantity)
strTotal = Format(dblTotal.ToString("N2"))
If chkDessert.Checked = True Then
strTotal += 5
End If
If chkDrink.Checked = True Then
strTotal += 2
End If
If rbtnDine.Checked = True Then
strTotal += (strTotal * 0.1)
MessageBox.Show("Table Number : " & txtNumber.Text & vbCrLf & "Total Bill : RM" & strTotal & "", "Message", MessageBoxButtons.OK, MessageBoxIcon.Information)
End If
If rbtnTake.Checked = True Then
strTotal += (strTotal * 0.05)
MessageBox.Show("Take Away" & vbCrLf & "Total Bill : RM" & strTotal & "", "Message", MessageBoxButtons.OK, MessageBoxIcon.Information)
End If
This code run nicely but the answer not get as two decimal places like what i want.. anybody can help me ?