VB & International Number Format
-
Hi folks, I'm rather inexperienced with VB, but since this is pretty easy with VC, I hope some of you gurus out there has done it before or has a hint. Think of a calculation, where you have a result of, 3/4 = 0.75 If I simply use the code ResultWindow = 3/4 the VB form will display "0.75" as desired. BUT: some languages, including German, use a different format, the figure above should be written "0,75" Speaking Windows, I'd rather get and put the number format as specified in the control panel. Anyone has an idea to do VB excatly this? Thomas BTW: for VC, this piece of code in OnInitInstance does all the job: setlocale( LC_ALL, "" );
-
Hi folks, I'm rather inexperienced with VB, but since this is pretty easy with VC, I hope some of you gurus out there has done it before or has a hint. Think of a calculation, where you have a result of, 3/4 = 0.75 If I simply use the code ResultWindow = 3/4 the VB form will display "0.75" as desired. BUT: some languages, including German, use a different format, the figure above should be written "0,75" Speaking Windows, I'd rather get and put the number format as specified in the control panel. Anyone has an idea to do VB excatly this? Thomas BTW: for VC, this piece of code in OnInitInstance does all the job: setlocale( LC_ALL, "" );
Take a look at FormatNumber() and FormatCurrency() functions.