json4delphi icon indicating copy to clipboard operation
json4delphi copied to clipboard

GLB_JSON_STD_DECIMALSEPARATOR

Open hafedh-trimeche opened this issue 4 years ago • 0 comments

Hi, JsonsUtils_GLB_DECIMALSEPARATOR would be replaced by GLB_JSON_STD_DECIMALSEPARATOR and not the opposite:

function FixedTryStrToFloat(const S: string; out Value: Extended): Boolean;
var
  FixedS: string;
begin
  if JsonsUtils_GLB_DECIMALSEPARATOR = GLB_JSON_STD_DECIMALSEPARATOR then
  begin
    Result := TryStrToFloat(S, Value);
  end
  else
  begin
    FixedS := StringReplace( S,
                             JsonsUtils_GLB_DECIMALSEPARATOR,
                             GLB_JSON_STD_DECIMALSEPARATOR,
                             [rfReplaceAll]);
    Result := TryStrToFloat(FixedS, Value);
  end;
end;

Best regards.

hafedh-trimeche avatar Jun 22 '21 23:06 hafedh-trimeche