Class LinearUnitFormat
Utility methods to format a decimal number to its different string representations.
Inheritance
Inherited Members
Namespace: netDxf.Units
Assembly: CADability.dll
Syntax
public static class LinearUnitFormat
Methods
| Improve this Doc View SourceToArchitectural(Double, UnitStyleFormat)
Converts a length value into its feet and fractional inches string representation.
Declaration
public static string ToArchitectural(double length, UnitStyleFormat format)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Double | length | The length value. |
| UnitStyleFormat | format | The unit style format. |
Returns
| Type | Description |
|---|---|
| System.String | A string that represents the length in feet and fractional inches. |
Remarks
The Architectural format assumes that each drawing unit represents one inch.
ToDecimal(Double, UnitStyleFormat)
Converts a length value into its decimal string representation.
Declaration
public static string ToDecimal(double length, UnitStyleFormat format)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Double | length | The length value. |
| UnitStyleFormat | format | The unit style format. |
Returns
| Type | Description |
|---|---|
| System.String | A string that represents the length in decimal units. |
ToEngineering(Double, UnitStyleFormat)
Converts a length value into its feet and decimal inches string representation.
Declaration
public static string ToEngineering(double length, UnitStyleFormat format)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Double | length | The length value. |
| UnitStyleFormat | format | The unit style format. |
Returns
| Type | Description |
|---|---|
| System.String | A string that represents the length in feet and decimal inches. |
Remarks
The Engineering format assumes that each drawing unit represents one inch.
ToFractional(Double, UnitStyleFormat)
Converts a length value into its fractional string representation.
Declaration
public static string ToFractional(double length, UnitStyleFormat format)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Double | length | The length value. |
| UnitStyleFormat | format | The unit style format. |
Returns
| Type | Description |
|---|---|
| System.String | A string that represents the length in fractional units. |
ToScientific(Double, UnitStyleFormat)
Converts a length value into its scientific string representation.
Declaration
public static string ToScientific(double length, UnitStyleFormat format)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Double | length | The length value. |
| UnitStyleFormat | format | The unit style format. |
Returns
| Type | Description |
|---|---|
| System.String | A string that represents the length in scientific units. |