Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » ElevateDB Technical Support » Support Forums » ElevateDB General » View Thread |
Messages 1 to 4 of 4 total |
Engine.FloatToSQLStr |
Thu, Aug 21 2008 9:58 AM | Permanent Link |
Heiko Knuettel | Hi,
It seems that the result of Engine.FloatToSQLStr is in some way influenced by machine settings. I have one PC in a network, on which Engine.FloatToSQLStr(10.2) results in '10,2'. On this specific PC the system settings for the decimal separator is changed to a dot (normally a comma in german) because other software needs this setting. On every other PC the decimal separator is set to german standard (comma), and the result of Engine.FloatToSQLStr is correct. Heiko |
Thu, Aug 21 2008 1:06 PM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. timyoung@elevatesoft.com | Heiko,
<< It seems that the result of Engine.FloatToSQLStr is in some way influenced by machine settings. >> Yes, it has to use the machine settings to determine how to format the string prior to a call to the FloatToStr function in Delphi, which does the actual conversion. << I have one PC in a network, on which Engine.FloatToSQLStr(10.2) results in '10,2'. On this specific PC the system settings for the decimal separator is changed to a dot (normally a comma in german) because other software needs this setting. >> I can't see how this would be possible. Here's the implementation of the FloatToSQLStr method internally in the engine: function FloatToSQLStr(Value: Double): TEDBString; begin Result:=FloatToString(Value); Result:=ReplaceString(Result,NumberDecimalChar,ANSI_DECIMAL_SEPARATOR); end; function FloatToString(Value: Double): TEDBString; begin Result:=FloatToStr(Value); end; (there is a bunch of multi-platform calls (.NET) in here that I removed for clarity's sake, but that is the reason for all of the nested function calls) The only way that could occur is if NumberDecimalChar is different from the DecimalSeparator Delphi global variable, and the NumberDecimalChar is initialized with the DecimalSeparator global variable at startup time in the initialization section for the edbstring.pas unit: initialization CurrencyDecimalChar:=DecimalSeparator; NumberDecimalChar:=DecimalSeparator; -- Tim Young Elevate Software www.elevatesoft.com |
Thu, Aug 21 2008 2:41 PM | Permanent Link |
Heiko Knuettel | Tim,
>>The only way that could occur is if NumberDecimalChar is different from the >>DecimalSeparator Delphi global variable, and the NumberDecimalChar is >>initialized with the DecimalSeparator global variable at startup time in the >>initialization section for the edbstring.pas unit Thanks. That was it...somewhere deep buried in a long forgotten unit I set the DecimalSeparator to a comma, that is after edbstring is initialized. At least sometimes I should take a look into the EDB source... Heiko |
Thu, Aug 21 2008 6:25 PM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. timyoung@elevatesoft.com | Heiko,
<< Thanks. That was it...somewhere deep buried in a long forgotten unit I set the DecimalSeparator to a comma, that is after edbstring is initialized. >> Damn, that's why it was mixed up. I was trying to come up with a reason for what you were seeing, but completely forgot that initialization order of the units could cause that. << At least sometimes I should take a look into the EDB source... >> Well, hopefully you shouldn't have to do so very often. -- Tim Young Elevate Software www.elevatesoft.com |
This web page was last updated on Sunday, May 5, 2024 at 07:30 PM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |