|
-
Dec 19th, 2007, 09:14 AM
#1
Thread Starter
Addicted Member
[RESOLVED]Convert Comma to Point
Hello;
When i save my variables to text all point convert to comma. Like below
Var1=2.2
if i save it to text
Print #1, Var1
it's look like 2,2 in text.
I rearange regional settings thus my problem fixed but wonder how can i save my data with point without make any changement on regional settings.
Thanks
Last edited by levent; Dec 21st, 2007 at 05:52 AM.
-
Dec 19th, 2007, 09:20 AM
#2
Re: Convert Comma to Point
-
Dec 19th, 2007, 09:30 AM
#3
Thread Starter
Addicted Member
Re: Convert Comma to Point
-
Dec 19th, 2007, 09:36 AM
#4
Re: Convert Comma to Point
-
Dec 19th, 2007, 10:43 AM
#5
Hyperactive Member
-
Dec 19th, 2007, 10:45 AM
#6
Hyperactive Member
-
Dec 19th, 2007, 11:19 AM
#7
Frenzied Member
Re: Convert Comma to Point
What Hack is saying is this:
Code:
Dim var1 as string
Var1 = "2.2"
filenum1 = FreeFile
Open "c:\1.txt" For Output As filenum1
Print #1, Var1
Or
Code:
Var1 = 2.2
filenum1 = FreeFile
Open "c:\1.txt" For Output As filenum1
Print #1, CStr(Var1)
-
Dec 19th, 2007, 02:51 PM
#8
Re: Convert Comma to Point
Options:
Str$(Var1)
Replace(CStr(Var1), ",", ".")
The problem here is locale settings, VB uses locale with certain functions. CStr, Format$ etc. use the system locale settings when handling values.
-
Dec 21st, 2007, 05:51 AM
#9
Thread Starter
Addicted Member
Re: Convert Comma to Point
Hi;
Print #1, Replace(CStr(Tbn1), ",", ".") worked.
Thanks everybody who helped
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|