Hi,
I am programming in VS2010 with C#.
I have this code:
if (e.Column.FieldName == "Value")
{
if ((Properties.Settings.Default.IsMGDL == false) && (CheckType(e.Value.ToString()) == false))
{
int eValue = Convert.ToInt32(e.Value) / 18;
e.DisplayText = (eValue).ToString();
}
else if ((Properties.Settings.Default.IsMGDL == true) && (CheckType(e.Value.ToString()) == true))
{
double eValue = Convert.ToDouble(e.Value) * 18;
e.DisplayText = (eValue).ToString();
}
}
Open in new window
In the first condition the calculated number has to round up in 1 decimal after the period.
or in my case the comma (f.e: 6,66666 has to be 6,7)
And in the second condition the calculated number as to round up as a whole number.
(f.e: 6,66666 has to be 7)
I hope I have explained it right!
How can I do that?
Peter
Peter