I am currently trying to round up the figure in my crystal report but the round function in crystal report does not change it to correct figure.
If the amount is 32,000, I want to convert it to 40,000 by rounding. If the amount is 24,000, I want to convert it to 30,000,
Is there any way to do this such rounding?
You can do something like:
int num = 32000;
string textNum = num.ToString();
//count number of zero
int countZero = textNum.Length - textNum.TrimEnd('0').Length;
//get a divisor to get a fraction
double divisor = (int)Math.Pow(10, (countZero + 1));
double firstDiv = num / divisor;
int val = (int)(Math.Ceiling(firstDiv) * divisor);
Hope that will help :)