Negative Decimal

I am tired of beating my head up against the desk. I've been trying to convert a positive decimal to a negative without the value calculating as a negative value. Math.Abs does half the job and I have no clue on how to convert.

Any help would be nice.

Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

StephanLead Software EngineerCommented:
Are you looking for this:

Gustav BrockCIOCommented:
> convert a positive decimal to a negative without the value calculating as a negative

So a negative should be positive??
Could you please provide an example?

Easwaran ParamasivamCommented:
The requirement is to convert Postive to Negative. But Math.Abs would convert Negative to Postive. Confusing.. What is the correct requirement?

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
CompTIA Network+

Prepare for the CompTIA Network+ exam by learning how to troubleshoot, configure, and manage both wired and wireless networks.

Gustav BrockCIOCommented:
OK. Back to school. Remember your pencil and the apple for the teacher.

Given: p = 1.11
Wanted: n = -1.11
Solution: n = -p


mBenton1979Author Commented:
is here is a portion of my test code. I'm looking at the food, liquor, and beer to display negative values without them adding or subtracting as such. If this doesn't work Ill just have to validate the fields and force the negative and tweak my code

 decimal food = System.Decimal.Parse(foodOperand.Text);
            decimal liquor = System.Decimal.Parse(liquorOperand.Text);
            decimal beer = System.Decimal.Parse(beerOperand.Text);

            decimal calculatedDeductions = subtractExpend(food, liquor, beer);
            textBox2.Text = calculatedDeductions.ToString();

private decimal subtractExpend(decimal food, decimal liquor, decimal beer)
            return food + liquor + beer;
Gustav BrockCIOCommented:
I see no negatives here.

> ..  without them adding or subtracting as such.

That means doing nothing. So what to do?
Perhaps if you provide an example, we can understand the issue.

Gustav BrockCIOCommented:

A solution to nothing?

mBenton1979Author Commented:
Oh snap I awarded the wrong person!! Guess no take backs huh?
Gustav BrockCIOCommented:
Oh, that explains.

No problem for me though, I'm not in it for the monye - just curious what the problem really was and what the solution might be?

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.