Formats a number as a fraction for inch measurements, with denominator as power of 2 (up to maximum of 128).
Return a fraction, or number and fraction (e.g. 3 5/8), or decimal number if the input is not
a power of 2 fraction (within 0.0000001)
Namespace: Autodesk.iLogic.Runtime
Assembly: Autodesk.iLogic.Runtime (in Autodesk.iLogic.Runtime.dll) Version: 29.0
Syntax
VB
Public Shared Function FormatAsFraction ( rVal As Double, numberOfDecimals As Integer ) As String
C#
public static string FormatAsFraction( double rVal, int numberOfDecimals )
Parameters
- rVal
- Type: System.Double
The number. - numberOfDecimals
- Type: System.Int32
Number of decimal places for output (only used if it's not a fraction).
Return Value
Type: StringEither a fractional string (e.g. 3 5/8) or a decimal string.
