2016-01-21 66 views
1
private void paymentHasMade (object sender, EventArgs e) 
{ 
    decimal total= 0; 
    try 
    { 
     total = decimal.Parse (txtamounttopay.Text.TrimStart('रु')) - decimal.Parse(txtpaymentamount.Text); 
    } 
} 
+0

'Text'将会出现什么情况? –

+0

它向我显示一个错误:字符文字太多字符 –

+0

什么是文本框的输入我的意思是 –

回答

2

改为使用string.Replace

total = decimal.Parse (txtamounttopay.Text.Replace("रु", string.Empty)) 
     - decimal.Parse(txtpaymentamount.Text); 
+0

thanq @juharr先生的工作 –