CoordinateToString(CoordinateFormatOptions) Method

A string formatted and represented coordinate.

Definition

Namespace: CoordinateSharp
Assembly: CoordinateSharp (in CoordinateSharp.dll) Version: 3.1.1.1
XMLNS for XAML: Not mapped to an xmlns.
C#
public string ToString(
	CoordinateFormatOptions options
)

Parameters

options  CoordinateFormatOptions
CoordinateFormatOptions

Return Value

String
Formatted Coordinate string

Example

The following example will demonstrate how to output a custom formatted string representation of a Coordinate.
C#
Coordinate c = new Coordinate(25, 25);

//Create the formatting object to pass to the ToString() overload.
CoordinateFormatOptions cfo = new CoordinateFormatOptions();

cfo.Format = CoordinateFormatType.Degree_Decimal_Minutes; //Set string format to DDM
cfo.Display_Leading_Zeros = true; //Display leading zeros
cfo.Round = 2; //Round to the 2nd decimal place

Console.WriteLine(c.ToString(cfo)); //N 25º 00' E 025º 00'

See Also