Displaying numbers without decimal points
I had a very similar problem a while ago and the answer is to use a format string when converting the number to a string. The way to solve your issue is to use a custom numeric format string of "0.#"
double x = 12;
double y = 12.1;
double z = 12.11;
Console.WriteLine(x.ToString("0.#"));
Console.WriteLine(y.ToString("0.#"));
Console.WriteLine(z.ToString("0.#"));
Will give you the following output:
12
12.1
12.1
This will return a number with a single (optional) decimal place.
String.Format("{0:0.#}", number)