<Code Lib>
M

UnitFormatUtils.Format(Units, UnitType, Double, Boolean, Boolean, FormatValueOptions)

Description:
Formats a number with units into a string.
Overloads (2):
Format(Units,UnitType,Double,Boolean,Boolean,FormatValueOptions)

public static string Format(
	Units units,
	UnitType unitType,
	double value,
	bool maxAccuracy,
	bool forEditing,
	FormatValueOptions formatValueOptions
)

  • units
    The units formatting settings, typically obtained from Document.GetUnits().
  • unitType
    The unit type of the value to format.
  • value
    The value to format, in Revit's internal units.
  • maxAccuracy
    True if the value should be rounded to an increased accuracy level appropriate for editing or understanding the precise value stored in the model. False if the accuracy specified by the FormatOptions should be used, appropriate for printed drawings.
  • forEditing
    True if the formatting should be modified as necessary so that the formatted string can be successfully parsed, for example by suppressing digit grouping. False if unmodified settings should be used, suitable for display only.
  • formatValueOptions
    Additional formatting options.
Return Value The formatted string. The formatted string.

Loading…