TOracleDataset.AsFloat

davydrey

Member
i have done a import program of data in text file in a single oracle table in oracle 7.3 for a customer.
When a affect the float field 'F' of my table 'T' like this :
TF.AsFloat:=StrToFloat(StringValue);
it's OK but on my customer's machine an error
appear: '2,6' is not a float value correct'
why ?
(My oracle client is Oracle 8i and his Client is Oracle 7.3 and i have tested it on a oracle 7.3 database with my client oracle 8i)...
 
Is 2,6 a correct numeric string for the regional settings of your customer? Or should it be 2.6?

------------------
Marco Kalter
Allround Automations
 
Originally posted by mkalter:
Is 2,6 a correct numeric string for the regional settings of your customer? Or should it be 2.6?


I don't know, i want to do a code that works in the two cases !
 
You have a lot of formatting variables in Delphi which determine these settings. You can read them, and you may also change them - this should be done in a try-finally clause, to ensure that it doesn't influence elsewhere.

e.g.
PrevDecSep:= DecimalSeparator;
try
DecimalSeparator:= ',';

finally
DecimalSeparator:= PrevDecSep;
end;

Helene
 
Thank you, It's OK !!!
thanks from a frenchie !

Davyd rey

Originally posted by helene:
You have a lot of formatting variables in Delphi which determine these settings. You can read them, and you may also change them - this should be done in a try-finally clause, to ensure that it doesn't influence elsewhere.

e.g.
PrevDecSep:= DecimalSeparator;
try
DecimalSeparator:= ',';

finally
DecimalSeparator:= PrevDecSep;
end;

Helene
 
Back
Top