How to convert Decimal result into Integer using C# in ASP.Net

Last Reply one month ago By YacharuP

Posted one month ago

hi

see below code:

LblResult.Text = (Convert.ToDouble(Lblcredit.Text) / Convert.ToDouble(12.9)).ToString();

when I run this code result is:

Lblresult.Text=567.123658596

 

I want it display in integer like

567

How I can convert it?

Best regards

neda

You are viewing reply posted by: YacharuP one month ago.
Posted one month ago

@nedash,

Try following code...

double b = 567.123658596;
Label1.Text = b.ToString();
Label2.Text = Convert.ToInt32(b).ToString();

 

I agree, here is the link: https://www.e-iceblue.com/Introduce/spire-office-for-net-free.html?aff_id=108