Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

change , to .

Status
Not open for further replies.

makisbest

Technical User
Mar 3, 2005
125
GR
Hi

My SQL Script return Decimal values with "," instend of "."
In my country is corect (Greece) but in VB doesnt.
Can I change that without changing the regional settings

Thank you.
 
Hi makisbest,

Dim a as string
a="124,35"
a=Replace(a, ",", ".")

So a="124.35"


----
Elpizw na se bohthisa!
 
Thank you for your help
but it doesnt work

apo pou eisai?
 
You might want to have a look at this thread222-409907

Or you could do a search on this forum for "regional decimal", it turns up several threads on the topic.

Hope this helps

HarleyQuinn
---------------------------------
Get the most out of Tek-Tips, read FAQ222-2244 before posting.
 
Why isn't it working? The returning result (variable a) is a string. It must be convered to a single or double precision number in order to use it for calculations.


---
Athens
 
makisbest, I've seen three posts from you related to this subject (each one with a slightly different question) and it isn't clear to me what you're trying to accomplish with this. TipGiver's code DOES work. When you say that it doesn't work, I suspect you mean that you're trying to apply it in a way that doesn't work.

Perhaps we can help you better if you explain what you're doing, and provide the related code that you are using. (Please try NOT to submit unrelated code; it's hard for people to look through 1000 lines of code to find the area that you're having trouble with.)

Hope this helps,

Bob
 
makisbest, this is Gerasimos

you could use the format function! In immediate window type

?Format("6124,35", "#,##0.00") - Press enter
6.124,35

So even our regional settings use comma for decimals,
format uses dot for decimals and comma for thousands. This way numbers are well accepted in a mdb using vb code even in our visual formating.

Kalo apogevma

(Ki ego makis eeee!?!?!?!?!)

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top