numeric formatting in vb6

i wanted to display integer and long number in textboxes with a thousand separators. in short, instead of displaying 5000000;  something like 5,000,000 make life quite easier.
cheers.

saf
winklezAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

PaulHewsCommented:
Dim lngNum As Long
lngNum = 5000000
Text1.Text = Format(lngNum, "#,##0")
0
winklezAuthor Commented:
but it is turning out to be a decimal point instead of being a thousand separator? it there anything wrong with  my computer settings? the operating system is in French
0
PaulHewsCommented:
>it there anything wrong with  my computer settings? the operating system is in French

If the regional settings in the control panel set the period to be the thousands separator, then that's what the Format function will use in VB.  That's what is expected by the user of such a system.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
The Ultimate Tool Kit for Technolgy Solution Provi

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy for valuable how-to assets including sample agreements, checklists, flowcharts, and more!

Arthur_WoodCommented:
If you are using as French version of Windows, then it is very probable that the Regional settings are configured for French as well, and that means that the Decimal separator is the comma (',') and the Thousands separator is the periond ('.')

so 1500 and 54/100 would be shown as 1.500,54

Change the regional settings, (Control Panel) to use . as the Decinal separator, and "," as the Thousands separator.

AW
0
Ashok KumarCommented:
You can also override the regional settings for this number formating. refer below link
http://dltechdev.com/vb/VBFormat.htm
0
PaulHewsCommented:
I don't see anything on that page to override regional settings.  You could do string replacements, but you have to know what the grouping and decimal settings are, which means using the GetLocaleInfo API.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.