Display personnal format for numeric value

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
 
E

eric_caron_31

Yes it's a numeric datatype but actually, it display ### ### not the
numeric value

Why ?
 
G

Greg Burns

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,564
Members
45,040
Latest member
papereejit

Latest Threads

Top