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 ArticleRe: 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 ArticleRe: 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 ArticleRe: 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 ArticleMake 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