Daniel Rikowski
Daniel Rikowski

Reputation: 72544

Use different locale for the Format function?

In a VB6 application I have to build a file which contains a decimal number which must always be written in US format:

1,499.99

But the Format function takes the system settings into account and on a German system this result would be produced: (Using the format string #,##0.00)

1.499,99

Can I force the Format function to use different settings?

Upvotes: 2

Views: 942

Answers (2)

MarkJ
MarkJ

Reputation: 30408

Str() will always use dot as decimal delimiter, however it won't use any digit separator. You would get " 1499.99" not "1,499.99". How's that for you?

As far as I know there is no way to force the VB6 Format() function to ignore system settings.

Upvotes: 2

SteelBytes
SteelBytes

Reputation: 6965

try using SetThreadLocale before FormatMessage

http://msdn.microsoft.com/en-us/library/dd374051(VS.85).aspx

Upvotes: 1

Related Questions