I'm making a small tip calculator for Windows Phone 7, and I'm almost ready:

I am having problems so that the final decimal places can do what I want. I want to show the result with only two decimal places. Any suggestions? Here is my code:
private void btnSubmit_Click(object sender, RoutedEventArgs e)
{
if (ValidateInputs())
{
lblTotalTip.Text = CalculateTip(txtTotalBill.Text, txtPercentage.Text);
}
}
private string CalculateTip(string Total, string Percentage)
{
decimal totalBill = decimal.Parse(Total);
decimal percentage = decimal.Parse(Percentage);
string result = ((percentage / 100) * totalBill).ToString();
return result;
}
private bool ValidateInputs()
{
return true;
}
delete
source
share