Thank you for reply.
Sorry, my question was not quite correct. I wonder if there is one format
code that provides the following:
Dec = 1.1234
Str2 = Dec.ToString(Some format) ' Str2 = "1.1234"
Dec = "1.0000"
Str2 = Dec.ToString(The same format as above) ' Str2 = "1"
Actually a program doesn't assign "1.0000" to Dec. The program reads data
from a decimal column in a SQL Server database.
Viktor
"Waran" <Wa***@discussions.microsoft.com> wrote in message
news:6E**********************************@microsof t.com...
Str2 = Dec.ToString("#,##0")
"Vik" wrote:
Dim Dec As Decimal, Str1, Str2 As String
Dec = 1
Str1 = Dec.ToString ' Str1 = "1"
Dec = "1.0000"
Str2 = Dec.ToString("G") ' Str2 = "1.0000"
Is it possible to format Str2 so that Str2 = "1"?
Thanks.