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.

 

What did you think of this article?




Trackbacks
  • No trackbacks exist for this post.
Comments
  • No comments exist for this post.
Leave a comment

Submitted comments are subject to moderation before being displayed.

 Name

 Email (will not be published)

 Website

Your comment is 0 characters limited to 3000 characters.