I would like to find a good way how I can best translate an integer value. I have a method TranslateValue in which comes a value 100. now the weird part of the number hundred is to increment the who from 0 to 100 and if the value that comes in the method is for example 0 then the value is 100 which the method returns. So in short I want to have a counter method that calculates the other way around I have failed many times but I can't find a good way that works
int currentValue = 0;
private int TranslateValue(int valueToTranslate)
{
if (valueToTranslate > 0)
{
currentValue++;
}
else
{
currentValue--;
}
}