I have a flexgrid cell that is not handling European number formatting how I want. Some details may be abstracted away from me in the code.
Currently, my control panel "local region" is set to the target location (Danish/Denmark).
I can successfully type in a decimal value, such as 12,36 in Danish format (In US format, of course this is 12.36).
This value is properly handled, and dealt with as it is passed off to SQL and used.
Afterwards, I assume various checks happen underneath, and upon this line
.Redraw = flexRDDirect
Where the grid tries to redraw, My numbers in this cell undergo some conversion.
An example
If I type in 12,36 I believe somehow the comma is being converted directly to a decimal point, and not properly formatted from Danish to US (or vice versa) with the inplace functions first. Then at some point, the cell is revalidated, and it assumes that this value 12.36 is in danish format still, which is equivalent to one thousand two hundred thirty six (but written poorly, as the thousands separator is in the wrong position).
So now my value of 12,36 (or 12.36 in US), has turned into 12.36 in Danish, which is really 1.236,00(Danish) when properly formatted (thousands separator in right position), which is now 100X my original value of 12,36
So is there something in vb6/flexgrid that is explicitly turning this comma into decimal point, and then attempting the local formatting afterwards (which essentially will multiple my value by 100)? Is there something being called with the .Redraw = flexRDDirect
line where I see the values change? I suspect that there is some custom code somewhere that is trying to accommodate local region formatting itself, without using the supplied functions. But maybe not!
All of this is not my area of coding expertise. If there's more detail required please let me know.
I've found the issue, and it was as I suspected; something else was trying to convert the numeric value and format it. The procedure at fault was trying to add 0's and a decimal point to the number. So when VB+region_settings handled it (properly), it was messed up.