A note for those using their own language ... lazarus / 43-Android ---------------------------------------------------------------------- shyub · 2021-04-08 08:05 In Russian, the separation of the integer part of the number from the fractional part is indicated by a comma, in English - by a dot. The "StrToFloat" function, unlike Windows, considers a comma to be an error. ---------------------------------------------------------------------- shyub · 2021-04-08 08:21 Just in case, I do it like this: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i procedure TAndroidModule1.AndroidModule1JNIPrompt(Sender: TObject);var  f: Single=1.2;  S: String;begin  .........  S:=FloatToStr(f);  Znak:=S[2];  .........end; Wherever you need it ... Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i ...........    k:=Pos('.',S);    if k<>0 then S[k]:=Znak;  end;  Result:=S;end; ---------------------------------------------------------------------- Handoko · 2021-04-08 08:28 My country use comma as decimal separator too. Maybe you don't know you can 'tell' StrToFloat to use what character as decimal separator. This code below causes no error, just warnings on compile-time. Tested on Lazarus 2.0.10. Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i procedure TForm1.Button1Click(Sender: TObject);var  S: string;begin   S := '1.2';  DecimalSeparator := '.';  ShowMessage(StrToFloat(S).ToString);   S := '1,2';  DecimalSeparator := ',';  ShowMessage(StrToFloat(S).ToString);   S := '1*2';  DecimalSeparator := '*';  ShowMessage(StrToFloat(S).ToString); end; If you interested to learn more, check the documentation. ---------------------------------------------------------------------- shyub · 2021-04-08 08:32 Thank you! Didn't know it worked on Android. ---------------------------------------------------------------------- white_zombie · 2021-04-08 08:36 In my country (Spain), the decimal separator is also the comma. The function "FloatToStr" has an overload where you can specified the format settings, see the next links. https://www.freepascal.org/docs-html/rtl/sysutils/floattostr.html https://www.freepascal.org/docs-html/rtl/sysutils/tformatsettings.html Best Regards ---------------------------------------------------------------------- marcov · 2021-04-08 08:42 On *nix (and Android is unixy) you need to add unit clocale as first unit (or at least early) of your mainprogram to enable loading the system locale. I don't know in how far this is implemented for android, but you could try ---------------------------------------------------------------------- shyub · 2021-04-08 08:44 Thank you!