// Collection of code snippets by Arne Vajhøj // (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) using System; namespace E { public class MainClass { public static void Main(string[] args) { /* for(int j = 0; j < 5; j++) { for(int i = 0; i < 2; i++) { double d = j + (5 + i * 10) / 1000.0; string s = Math.Round(d, 2).ToString("#.00"); if(int.Parse(s.Substring(s.Length-1)) % 2 != 0) { Console.WriteLine(d + " " + s); } } } */ Console.WriteLine(Math.Round(1.015, 2)); Console.WriteLine(Math.Round(2.015, 2)); Console.WriteLine(Math.Round(3.015, 2)); Console.WriteLine(Math.Round(4.015, 2)); } } }