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 GuptaPosted Mar 2, 2018, 1:21 AM
Amitabh BaidehiPosted Mar 2, 2018, 1:22 AM
string a = value.ToString();
string[] b = a.Split('.');
int firstValue = int.Parse(b[0]);
int secondValue = int.Parse(b[1]);
Rafnas T PPosted Mar 2, 2018, 1:17 AM
Amitabh BaidehiPosted Mar 2, 2018, 1:08 AM
Amit GuptaPosted Mar 1, 2018, 10:55 AM