' ' is not a valid float lazarus / 13-General ---------------------------------------------------------------------- maryg · 2017-02-18 08:30 im currently working on a program that when a certain number is inserted in the first TEdit and a calculate button is clicked the second TEdit displays the total and the third TEdit displays the mean of the total. but when i run the program and click on the calculate button i get a " ' ' is not a valid float" error. i've gone through the code and even had a look at the string grid example but i still get the error. what could be the cause of this? ---------------------------------------------------------------------- Thaddy · 2017-02-18 08:43 An edit control is always a string representation in the case of a float. You need to convert it to a real float before you can use it in calculations. The best way to do that is with TryStrToFloat see: http://www.freepascal.org/docs-html/rtl/sysutils/trystrtofloat.html From the release of 3.0.2 yesterday you can also do 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 TForm1.Button1Click(Sender: TObject);var   s:single;  //or double, whateverbegin  // no helpers for UTF8 yet, but AnsiString.  s:=AnsiString(edit1.Text).ToSingle;  // or ToDouble...  caption := FloatToStr(s);  // do something, so we know it worksend;