{$mode objfpc}{$H+}
uses fphttpclient, fpjson, jsonparser;
Var
S : String;
J: TJSONData;
initialAmount, endAmount, rate: real; // or single or Double
begin
With TFPHttpClient.Create(Nil) do
try
S:=Get('http://api.fixer.io/latest?base=GBP');
finally
Free;
end;
J:= GetJSON(S);
rate := J.FindPath('rates.PLN').AsFloat;
writeln ('Current exchange rate of GBP to Polish złoty: ',rate:2:2);
writeln;
write ('Enter initial amount in GBP £');
readln (initialAmount);
endAmount := initialAmount * rate;
writeln (endAmount);
end.
This has been typed directly on the browser form a quick look around I don't see any errors. If you have problems please post the error reported and I"ll try to fix it.