AFValue.DisplayValue Method (Int32, IFormatProvider, Boolean)
- Last UpdatedNov 18, 2025
- 3 minute read
- PI System
- AF SDK 2024 R2
- Developer
Namespace: OSIsoft.AF.Asset
Assembly: OSIsoft.AFSDK (in OSIsoft.AFSDK.dll) Version: 3.1.1.1182
Syntax
public string DisplayValue( int displayDigits, IFormatProvider provider = null, bool addUOMAbbreviation = true )
Public Function DisplayValue ( displayDigits As Integer, Optional provider As IFormatProvider = Nothing, Optional addUOMAbbreviation As Boolean = true ) As String Dim instance As AFValue Dim displayDigits As Integer Dim provider As IFormatProvider Dim addUOMAbbreviation As Boolean Dim returnValue As String returnValue = instance.DisplayValue(displayDigits, provider, addUOMAbbreviation)
public: String^ DisplayValue( int displayDigits, IFormatProvider^ provider = nullptr, bool addUOMAbbreviation = true )
member DisplayValue : displayDigits : int * ?provider : IFormatProvider * ?addUOMAbbreviation : bool (* Defaults: let _provider = defaultArg provider null let _addUOMAbbreviation = defaultArg addUOMAbbreviation true *) -> string
Parameters
- displayDigits
- Type: SystemInt32
A zero or positive number indicates the number of digits to the right of the decimal point. A negative number indicates the number of significant digits to display. - provider (Optional)
- Type: SystemIFormatProvider
An object that supplies culture-specific formatting information. If , then the NumberFormatInfo associated with the current culture is used. - addUOMAbbreviation (Optional)
- Type: SystemBoolean
If , the value's UOM abbreviation is added to the returned display value the value's UOM is defined.
Return Value
Type: StringReturns the string representation of the Value as specified by the rules for displayDigits, the value's Type, and formated by the provider. Optionally, the value's UOM abbreviation is added.
Remarks
This method encapsulates the rules for converting a value to be displayed based upon the specified number of display digits. The value for the displayDigits parameter is normally obtained from the attribute's DisplayDigits property.
| If the value is not a Single, Double, or Decimal, then the displayDigits parameter is not used to format the returned display value. |