C#
I'm currently working on a hotel management system's invoice (asp.net c#)... My question is that how to show the round off on a label example if the total amount is 8023.25 round off label should show .25 and totallabel should show 8023... Please can anybody help me with this {with code} ???
}
Actually i've tried the following code:
public void texboxtolabel()
{
decimal amt;
bool isAValid = decimal.TryParse(total.Text, out amt);
decimal value = (decimal)amt;
if (isAValid)
popopop.Text = (amt - value).ToString();
durration();
amountintax();
amountinwords();
nameeee.Text = cname.Text;
companynamee.Text = companyy.Text;
gstinnnnn.Text = gstin.Text;
phoneeee.Text = mobile.Text;
addressss.Text = address.Text;
boooookingid.Text = bookingno.Text;
rooomnoo.Text = roomnumber.Text;
nooffpersoon.Text = noofperson.Text;
checkinnn.Text = from.Text;
checkoutttt.Text = to.Text;
tariff.Text = TextBox1.Text;
amount.Text = price.Text;
cgstamoount.Text = taxonpricehalf.Text;
sgstamoount.Text = taxonpricehalf.Text;
taxxxter.Text = taxwithdiscount.Text;
roundoff.Text = popopop.Text;
billamount.Text = value.ToString();but it is not working
Any body can help me please...!

Amit GuptaRank #190 · 12.8K reputationPosted Mar 1, 2018, 8:21 PM EST
Amit GuptaRank #190 · 12.8K reputationPosted Mar 1, 2018, 5:55 AM EST
Amitabh Baidehi19 reputationPosted Mar 1, 2018, 8:08 PM EST
Rafnas T PRank #280 · 8.8K reputationPosted Mar 1, 2018, 8:17 PM EST
Amitabh Baidehi19 reputationPosted Mar 1, 2018, 8:22 PM EST
string a = value.ToString();
string[] b = a.Split('.');
int firstValue = int.Parse(b[0]);
int secondValue = int.Parse(b[1]);