|
-
Mar 28th, 2006, 04:12 PM
#1
Thread Starter
Junior Member
Decimal Separator
Does anyone know how to change the decimal separator in vb.
Thanks
-
Mar 28th, 2006, 04:58 PM
#2
PowerPoster
Re: Decimal Separator
 Originally Posted by guicarpi
Does anyone know how to change the decimal separator in vb.
Thanks
what do you mean?
-
Mar 28th, 2006, 06:03 PM
#3
Thread Starter
Junior Member
Re: Decimal Separator
my defaut decimal separator is a comma (i'm french).
for example : 2/4 = 0,5
But I want to change it to a dot.
for example : 2/4 = 0.5
Is it possible ?
Thanks
-
Mar 28th, 2006, 06:08 PM
#4
Re: Decimal Separator
VB Code:
MsgBox Replace(2 / 4, ",", ".")
-
Mar 28th, 2006, 06:28 PM
#5
Thread Starter
Junior Member
Re: Decimal Separator
ok but is it possible to change the defaut value ?
-
Mar 28th, 2006, 06:31 PM
#6
Re: Decimal Separator
Internally the decimal point isn't stored as part of the value, it's only when you display the value the decimal point is inserted into the correct position, and it will use the regional settings of your computer to determent what that is. You can change your regional settings using the control panel.
-
Mar 28th, 2006, 06:34 PM
#7
Re: Decimal Separator
You would need to customize or change your regional settings, however that affects everything not just your vb program.
-
Mar 28th, 2006, 08:29 PM
#8
Re: Decimal Separator
If you want you can change it with this
Many programs do it, but in my apps I prefer not to do it. I get the decimal separator each 2 seconds (the user could change it while your app is open) then I just let the user use that separator when validating the entry.
It's also possible to let him use both, and make a replace before using the numbers for calculations, but I think it's not a good idea.
-
Mar 28th, 2006, 10:11 PM
#9
Addicted Member
Re: Decimal Separator
if it is a program that converts a fraction to decimal you can perform the (division) math operation
2/4 will automatically become 0.5
same with 1/2 will also become 0.5
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
|