Display personnal format for numeric value

  • Thread starter Thread starter eric_caron_31
  • Start date Start date
E

eric_caron_31

Here's my problem, I read numeric value and I want to display this
value like this : 123 678.

Value read : 123678
Value display : 123 678

I want space for separator

thanks for your help
 
Yes it's a numeric datatype but actually, it display ### ### not the
numeric value

Why ?
 
Dim s As String

' Gets a NumberFormatInfo associated with the en-US culture.
Dim nfi As System.Globalization.NumberFormatInfo = New
System.Globalization.CultureInfo("en-US", False).NumberFormat
nfi.NumberDecimalDigits = 0

' Displays a value with the default separator (",").
Dim myInt As Int64 = 123678
s = myInt.ToString("N", nfi)

' Displays the same value with a blank as the separator.
nfi.NumberGroupSeparator = " "

s = myInt.ToString("N", nfi)


maybe overkill for what you are looking to do...

Greg
 
Back
Top