CSharp examples for System:Math Number
Formats the distance.
using System;/*from w ww . j av a2s . c om*/ public class Main{ /// <summary> /// Formats the distance. /// </summary> /// <returns>The distance in meters</returns> /// <param name="distance">Distance.</param> public static string FormatDistance(double distance) { var km = distance / 1000; var roundedKm = Math.Round (km, 1); return string.Format ("{0}km", roundedKm); } }