Display map distance with limited significant digits in C#


The post Measure distance on a map with a scale in C# lets you measure a distance 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 3741.25310780188 feet.

This example uses the ToSignificantDigits extension method describe in the the post Display significant digits in C# to display this value more nicely.

See those two examples and the source code in this post for the details.

Download Example   Follow me on Twitter   RSS feed   Donate

This entry was posted in algorithms, extension methods, graphics, mathematics, strings and tagged , , , , , , , , , , , , , , , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.