Click or drag to resize

MathStringFormatAsFraction Method (Double, Int32)

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: 23.0
Syntax
Public Shared Function FormatAsFraction ( 
	rVal As Double,
	numberOfDecimals As Integer
) As String

Parameters

rVal
Type: SystemDouble
The number.
numberOfDecimals
Type: SystemInt32
Number of decimal places for output (only used if it's not a fraction).

Return Value

Type: String
Either a fractional string (e.g. 3 5/8) or a decimal string.
See Also