Decimal point

Decimal point

Anonymous
Not applicable
246 Views
4 Replies
Message 1 of 5

Decimal point

Anonymous
Not applicable
Bonjour,

With VBA, but i think it is the same with VB, how can i force Windows NT4 to
use the decimal point "." and not the "," for the reals numbers.

I think it is with an API, but...

Bernard
0 Likes
247 Views
4 Replies
Replies (4)
Message 2 of 5

Anonymous
Not applicable
Try 'Control Panel>Regional Settings>Number>Decimal Symbol'. VBA uses the
system default.
(At least, that's where it's defined in Win98SE.)
-- Walter -- http://www.ActiveDwg.com

Bernard Flavignard wrote in message
news:17BE43F38AA70E2BAA65E4E7D574577E@in.WebX.SaUCah8kaAW...
> Bonjour,
>
> With VBA, but i think it is the same with VB, how can i force Windows NT4
to
> use the decimal point "." and not the "," for the reals numbers.
>
> I think it is with an API, but...
>
> Bernard
>
0 Likes
Message 3 of 5

Anonymous
Not applicable
Walter,
Yes i know this method, but i want do that WITH vba,
not with 'Control Panel>Regional Settings>Number>Decimal Symbol'

Thanks

Walter a écrit dans le message :
E4C6C3B1B11DA4D49C05610CCD241C7C@in.WebX.SaUCah8kaAW...
> Try 'Control Panel>Regional Settings>Number>Decimal Symbol'. VBA uses the
> system default.
> (At least, that's where it's defined in Win98SE.)
> -- Walter -- http://www.ActiveDwg.com
>
> Bernard Flavignard wrote in message
> news:17BE43F38AA70E2BAA65E4E7D574577E@in.WebX.SaUCah8kaAW...
> > Bonjour,
> >
> > With VBA, but i think it is the same with VB, how can i force Windows
NT4
> to
> > use the decimal point "." and not the "," for the reals numbers.
> >
> > I think it is with an API, but...
> >
> > Bernard
> >
>
0 Likes
Message 4 of 5

Anonymous
Not applicable
Bonjour Bernard,

Usually all internal conversions are done using Windows System Settings.
If you want to do it otherwise, you may have to use string values and handle
the conversion yourself.

Luc Morrissette,
Flairbase inc.

"Bernard Flavignard" wrote in message
news:B7878FC343CC132CE548E79F0BBDF6F0@in.WebX.SaUCah8kaAW...
> Walter,
> Yes i know this method, but i want do that WITH vba,
> not with 'Control Panel>Regional Settings>Number>Decimal Symbol'
>
> Thanks
>
> Walter a écrit dans le message :
> E4C6C3B1B11DA4D49C05610CCD241C7C@in.WebX.SaUCah8kaAW...
> > Try 'Control Panel>Regional Settings>Number>Decimal Symbol'. VBA uses
the
> > system default.
> > (At least, that's where it's defined in Win98SE.)
> > -- Walter -- http://www.ActiveDwg.com
> >
> > Bernard Flavignard wrote in message
> > news:17BE43F38AA70E2BAA65E4E7D574577E@in.WebX.SaUCah8kaAW...
> > > Bonjour,
> > >
> > > With VBA, but i think it is the same with VB, how can i force Windows
> NT4
> > to
> > > use the decimal point "." and not the "," for the reals numbers.
> > >
> > > I think it is with an API, but...
> > >
> > > Bernard
> > >
> >
>
0 Likes
Message 5 of 5

Anonymous
Not applicable
Bonjour Bernard,

Sorry for answering so late.

It was so difficult to connect to this server a few months ago, I stopped
making a habit of it.

If you want to get rid of your "virgule", this could be a solution.

Denis

'----------------------------

Private Declare Function GetUserDefaultLCID _
Lib "kernel32" () As Long

Private Declare Function GetLocaleInfo Lib "kernel32" Alias _
"GetLocaleInfoA" (ByVal Locale As Long, ByVal LCType As Long, _
ByVal lpLCData As String, ByVal cchData As Long) As Long

Private Declare Function SetLocaleInfo Lib "kernel32" Alias _
"SetLocaleInfoA" (ByVal Locale As Long, ByVal LCType As Long, _
ByVal lpLCData As String) As Long

Public Const LOCALE_SDECIMAL = &HE

Public Sub main()
Dim locId As Long
Dim decSep As String * 255

locId = GetUserDefaultLCID
GetLocaleInfo locId, LOCALE_SDECIMAL, decSep, 255
If Left(decSep, 1) = "," Then
If MsgBox("Voulez-vous changer le séparateur décimal " _
& vbCrLf & " (la Virgule sera remplacée par un Point)?", _
vbQuestion + vbYesNo, "Paramètres Régionaux") = vbYes Then
If SetLocaleInfo(locId, LOCALE_SDECIMAL, ".") Then _
MsgBox "Opération Complétée ", vbInformation
End If
End If

'------------------------------------------------

"Bernard Flavignard" a écrit dans le message news:
17BE43F38AA70E2BAA65E4E7D574577E@in.WebX.SaUCah8kaAW...
> Bonjour,
>
> With VBA, but i think it is the same with VB, how can i force Windows NT4
to
> use the decimal point "." and not the "," for the reals numbers.
>
> I think it is with an API, but...
>
> Bernard
>
0 Likes