Código Delphi [-] function StrToFloatDec(s: string; SeparadorDecimal: char): double; begin if (DecimalSeparator <> SeparadorDecimal) then s := StringReplace(s, SeparadorDecimal, DecimalSeparator, []); Result := StrToFloat(s); end;
function StrToFloatDec(s: string; SeparadorDecimal: char): double; begin if (DecimalSeparator <> SeparadorDecimal) then s := StringReplace(s, SeparadorDecimal, DecimalSeparator, []); Result := StrToFloat(s); end;
Código Delphi [-] function StrToFloatDef(s: string; Default: double): double; begin try // Quito el separador de miles s := Trim(StringReplace(s, ThousandSeparator, '', [rfReplaceAll])); if (s = '') then Result := Default else Result := StrToFloat(s); except Result := Default; end; end;
function StrToFloatDef(s: string; Default: double): double; begin try // Quito el separador de miles s := Trim(StringReplace(s, ThousandSeparator, '', [rfReplaceAll])); if (s = '') then Result := Default else Result := StrToFloat(s); except Result := Default; end; end;