ApsGis.dll

Geodetic.Longitude.ParsePrecision Method

Parses precision from the provided string.

public static bool ParsePrecision(
   string str,
   out int precision,
   out string errorMessage
);

Parameters

str
a string to be parsed
precision
the precision, passed by reference (out)
errorMessage
an error message, passed by reference (out), that contains detailed error / warning information

Return Value

true - the function has succeeded, false - it has failed

Remarks

The function verifies validity of the parsing result. The valid precision is an integer number in the range from 0 (inclusive) to 15 (inclusive).

Example

This sample shows how to call the Geodetic.Longitude.ParsePrecision method from C# code:

 string errorMessage = String.Empty;
 
 string str = "13";
 int precision = 0;

 if (Geodetic.Longitude.ParsePrecision(str, out precision, out errorMessage))
 {
     Console.WriteLine("Precision: " + precision.ToString());
 }
 else
 {
     Console.WriteLine(errorMessage);
 }
 

See Also

Longitude Class | ApsGis Namespace