Rate this:
See more:
Hello guys,

Could you help me ,
I'm having some problem in the negative sign(-) in the integer.
all i want is to remove the negative sign in the integer
but i just dont know ....

here's my code...
``` If RS1_1.Checked = True Then Temp_PC = Temp_PC + 1 Else Temp_PC = Temp_PC - 1 TXTSPC.Text = Temp_PC End If ```

Posted 13-Jul-10 19:27pm

Rate this:

## Solution 1

If you want to make a number be positive, no matter how it starts, use Math.Abs. If you want to remove the sign from a string, you can use math.Abs, or String.Replace.

You should consider buying a basic VB.NET book to help you with these sort of questions.
Rate this:

## Solution 4

Hi, here is a solution for your question.

if arrval is a negative value
```if (arrval < 0)
{
arrval = arrval * (-1);
}```
Rate this:

## Solution 3

Use the `Math.Abs()` method.

EDIT -----------

Sorry, didn't know Christian had already suggested it. If the OP had marked it as answered, I wouldn't have bothered with a response.
v3
aspdotnetdev at 14-Jul-10 14:34pm

FYI, you can just delete your answer if you like. I could too, but I figured I'd leave the decision up to you.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

 0 Sergey Alexandrovich Kryukov 338 1 _Amy 290 2 Maciej Los 260 3 Manfred R. Bihy 200 4 OriginalGriff 195
 0 OriginalGriff 7,445 1 Sergey Alexandrovich Kryukov 6,347 2 Maciej Los 3,799 3 Peter Leow 3,558 4 CHill60 2,702

Advertise | Privacy | Mobile
Web02 | 2.8.140721.1 | Last Updated 27 Jun 2013