BLOG.CSHARPHELPER.COM: Measure distances on a map with a scale and display them with limited significant digits in C#
Measure distances on a map with a scale and display them with limited significant digits in C#
The example Measure distances on a map with a scale in C# lets you measure distances on a map. However, it displays too many significant digits in the results to look nice. For example, the sample picture displays the distance around the lake as 1219.71581838783 yards.
This example uses the ToSignificantDigits extension method describe in the the example Display a floating point number with a specific number of significant digits in C# to display this value more nicely.
See those two examples and the source code for the details.
Comments