# help. c# asp.net computation RSS

## 2 replies

Last post Sep 26, 2018 08:05 AM by Nasser Malik

• paminchever

Member

28 Points

278 Posts

### help. c# asp.net computation

i have this computation:

double totalholidays = Convert.ToDouble(Session["toteiddays"].ToString());

lblleavedays.Text = Convert.ToString(GetWorkingDays(dtfrom, dtto) - totalholidays);

but the problem is some of the answer got an (-) i want to remove the (-) in the total lblleavedays.text

• vahid bakkhi

Star

8089 Points

2779 Posts

### Re: help. c# asp.net computation

Sep 26, 2018 06:28 AM|vahid bakkhi|LINK

hi

you can use below sample

``` var num = -10;
var myInt = num * -1;```

```           double totalholidays = Convert.ToDouble(Session["toteiddays"].ToString());
var result = GetWorkingDays(dtfrom, dtto) - totalholidays;
if (result < 0)
result = result * -1;
lblleavedays.Text = result.ToString();```

vahid bakhtiary

• Nasser Malik

Star

13440 Points

2762 Posts

### Re: help. c# asp.net computation

Sep 26, 2018 08:05 AM|Nasser Malik|LINK

#### paminchever

but the problem is some of the answer got an (-) i want to remove the (-) in the total lblleavedays.text

You String Replace Function

`lblleavedays.Text = Convert.ToString(GetWorkingDays(dtfrom, dtto) - totalholidays).Replace('-',''); `

You can replace either character or string. For string use double quotes

`"-123".Replace("-"," ")`

Regards