Quantcast
Channel: Make a number ALWAYS negative in C#
Browsing latest articles
Browse All 5 View Live

Re: Make a number ALWAYS negative in C#

You could simply guarantee that the negative value would be stored by taking the absolute value of your variable and negating it :public static int Negative(int i) { return -Math.Abs(i); }You can see...

View Article


Re: Make a number ALWAYS negative in C#

Nataraj Gandhi ArunachalamHi,Not clear with the question. Is your requirement that only a negative number is stored in the particular table or even if a positive number is stored, in that case, your...

View Article


Re: Make a number ALWAYS negative in C#

Hi,If you want it to be negative whether it was negative beforehand or not, you would use:abc = -Math.Abs(abc);

View Article

Re: Make a number ALWAYS negative in C#

Hi,Not clear with the question. Is your requirement that only a negative number is stored in the particular table or even if a positive number is stored, in that case, your method that fetches that...

View Article

Make a number ALWAYS negative in C#

How do I make sure a value is return as a negative number?The developer could put a 27 in the database or a -27 in a string format, but I need to always make sure my method that returns the value is...

View Article

Browsing latest articles
Browse All 5 View Live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>