ToString Method
ToString(double, int)
Converts a double value to a string.
Note that a separate method ToString(float, int) exists for converting
float values, separate methods are needed to avoid rounding errors that may occur when
converting doubles to floats and vice versa.
The value to convert.
The count of digits after decimal point.
Declaration
public static string ToString(double value, int decimalPlaces)
Public Shared Function ToString(value As Double, decimalPlaces As Integer) As String
Parameters
Type |
Name |
Description |
double |
value |
|
int |
decimalPlaces |
|
Returns
ToString(float, int)
Converts a float value to a string.
Note that a separate method ToString(double, int) exists for converting
double values, separate methods are needed to avoid rounding errors that may occur when
converting doubles to floats and vice versa.
Declaration
public static string ToString(float value, int decimalPlaces)
Public Shared Function ToString(value As Single, decimalPlaces As Integer) As String
Parameters
Type |
Name |
Description |
float |
value |
The value to convert.
|
int |
decimalPlaces |
The count of digits after decimal point.
|
Returns
ToString()
Declaration
public override string ToString()
Public Overrides Function ToString() As String
Returns
Overrides