Re: Problem with decimals
Can't you use a Currency data type?
Re: Problem with decimals
It´s a legacy application that have been working for years.
This is a recent problem, so I don´t think that change the database column type
is the best solution. It´s a ruge impact.
tks.
Re: Problem with decimals
Well, what can we do, if it's NOT the code?
Re: Problem with decimals
Well, I thought that people in this forum could have face a problem like this.
I think it could be something like windows hotfix conflicting with this old crystal/vb...
and I was hoping that maybe you be experienced enough to help me, because right now,
i´m desperate.
I believe that this problem is less programming skill and more about experience/know how.
Re: Problem with decimals
Just because it used to work, doesn't mean that a change in coding can't fix it. In addition to the Currency data type, there is also the Format() function, which can return a number in the format of your choosing.
[SOLVED] Re: Problem with decimals
I fixed it.
Before I call the report I change the regional settings by code using kernel32 api.
And change it back after the report is loaded.
Private Declare Function SetLocaleInfo Lib "kernel32" Alias "SetLocaleInfoA" (ByVal Locale As Long, ByVal LCType As Long, ByVal lpLCData As String) As Boolean
Dim wInfo As Long
Dim Locale As Long
Locale = GetUserDefaultLCID()
wInfo = SetLocaleInfo(Locale, &H16, ".")
It still doesn´t explain why it was working in some computer and others not (they have the same regional settings configuration and same version off all software).
But... it´s working now.
Sometimes i think that computers is not a exact science as it should be :D
tks.
Re: Problem with decimals
Well done.
But it IS an exact science. It is possibly the most exact science there is at all, being always reduced down to 0 and 1. :)
However, it is possibly also a very complex and sometimes intransparent science. But always exact. ;)
Re: Problem with decimals
There is a saying; The nice thing about computers is that they do exactly what you tell them to do. The bad thing about computers is that they do exactly what you tell them to do.
Re: Problem with decimals