Jump to content
Xtreme .Net Talk

decimal seperator


Recommended Posts

Posted

In my application i am filling in some textboxes where the value is a double. The problem is that you don't know what the decimal seperator is on a computer using your application (this can be a . or a , ).

 

for example:

 

var1 = cdbl(textbox.text) 'value of the textbox is 1.7

or

var2 = cdbl(textbox.text) 'value of the textbox is 1,7

 

When the decimal seperator of the operating system is a . then you get for var1 the value 1.7 and for var2 the value 17

 

How can i catch this so the user doesn't need to worry about a . or , when filling in this form?

 

Is there a command where i can get the default seperator of the operating system? Or some other way to catch this problem?

 

I hope someone has the answer to this "little" problem.

tnx

Posted

sorry, but it doesn't work, i still have the same problem with it. Tnx anyway.

 

There must be a solution... anyone? :'(

  • *Experts*
Posted

It would only parse out , correctly if the current locale was set

to something that used , as decimal seperator. Try setting your

decimal seperator to , and trying it again.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...