AFValue.DisplayValue Method (Decimal, Int32, IFormatProvider)
- Last UpdatedNov 18, 2025
- 3 minute read
- PI System
- AF SDK 2024 R2
- Developer
Displays the Decimal value based upon the specified number of display digits.
Namespace: OSIsoft.AF.Asset
Assembly: OSIsoft.AFSDK (in OSIsoft.AFSDK.dll) Version: 3.1.1.1182
Syntax
public static string DisplayValue( decimal value, int displayDigits, IFormatProvider provider = null )
Public Shared Function DisplayValue ( value As Decimal, displayDigits As Integer, Optional provider As IFormatProvider = Nothing ) As String Dim value As Decimal Dim displayDigits As Integer Dim provider As IFormatProvider Dim returnValue As String returnValue = AFValue.DisplayValue(value, displayDigits, provider)
public: static String^ DisplayValue( Decimal value, int displayDigits, IFormatProvider^ provider = nullptr )
static member DisplayValue : value : decimal * displayDigits : int * ?provider : IFormatProvider (* Defaults: let _provider = defaultArg provider null *) -> string
Parameters
- value
- Type: SystemDecimal
The value to be converted to a display value based upon the displayDigits parameter. - 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.
Return Value
Type: StringReturns the string representation of the value as specified by the rules for displayDigits and formated by the provider.
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. |