SPFieldNumber.GetFieldValueAsHtml Method (Double, CultureInfo, Boolean, SPNumberFormatTypes)
Returns the field value in HTML format based on the specified data, culture information, Boolean value, and number format in order to render the field value directly on the page.
Namespace: Microsoft.SharePoint
Assembly: Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Available in Sandboxed Solutions: Yes
Available in SharePoint Online
Syntax
'Declaration
Public Shared Function GetFieldValueAsHtml ( _
data As Double, _
culture As CultureInfo, _
showAsPercentage As Boolean, _
displayFormat As SPNumberFormatTypes _
) As String
'Usage
Dim data As Double
Dim culture As CultureInfo
Dim showAsPercentage As Boolean
Dim displayFormat As SPNumberFormatTypes
Dim returnValue As String
returnValue = SPFieldNumber.GetFieldValueAsHtml(data, _
culture, showAsPercentage, displayFormat)
public static string GetFieldValueAsHtml(
double data,
CultureInfo culture,
bool showAsPercentage,
SPNumberFormatTypes displayFormat
)
Parameters
data
Type: System.DoubleA System.Double object that represents the value to convert to HTML format.
culture
Type: System.Globalization.CultureInfoA System.Globalization.CultureInfo object that contains information about the specific culture represented through the field.
showAsPercentage
Type: System.Booleantrue to display field values as a percentage; otherwise, false.
displayFormat
Type: Microsoft.SharePoint.SPNumberFormatTypesAn SPNumberFormatTypes value that specifies the number of decimal places to use.
Return Value
Type: System.String
A string that contains the value in HTML format.