R
rocio
How can I format a string like this: 12924.999999999999
to print 12,925 ?
to print 12,925 ?
rocio said:How can I format a string like this: 12924.999999999999
to print 12,925 ?
How can I format a string like this: 12924.999999999999
to print 12,925 ?
BeGomes said:Convert your string to a double, and then convert it back
to a string.
I use the following code to convert doubles to string:
Dim value as double
Dim result As String
Dim nfi As NumberFormatInfo
nfi = New CultureInfo("en-US", False).NumberFormat
nfi.NumberDecimalSeparator = "." 'set the decimal sep.
nfi.NumberGroupSeparator = "," 'set de grup sep.
nfi.NumberDecimalDigits = "0" 'set the number of decim.
result = value.ToString("N", nfi)
Try it out!