DistanceFromFractionalFeetAndInchesString Method (String, IFormatProvider, DistanceUnitType) |
Creates a distance from a string representation of fractional feet and inches.
Namespace: Tekla.Structures.Datatype
Assembly: Tekla.Structures.Datatype (in Tekla.Structures.Datatype.dll) Version: 2023.0.3
Syntax
public static Distance FromFractionalFeetAndInchesString( string text, IFormatProvider formatProvider, DistanceUnitType unitType )
Parameters
- text
- Type: SystemString
The distance string. - formatProvider
- Type: SystemIFormatProvider
The number format provider. - unitType
- Type: Tekla.Structures.DatatypeDistanceUnitType
The unit type of the distance to parse.
Return Value
Type: DistanceThe representation of the specified distance.
Exceptions
Exception | Condition |
---|---|
FormatException | Thrown if the text does not represent a distance. |
Examples
This example shows how to specify a format provider and a unit type when parsing
a Distance instance from a fractional string representation of
feet and inches.
using Tekla.Structures.Datatype; using System.Globalization; public class Example { public void Example1() { Distance distance = Distance.FromFractionalFeetAndInchesString("3' 3/4", CultureInfo.InvariantCulture, Distance.UnitType.Inch); } }
See Also