Code: Select all
var ff1, ff2, ff3 : real;
txt : array[23] of char;
...
ff1 := -374.2;
ff2 := 123.456789;
ff3 := 0.000001234;
FloatToStr(ff1, txt); // txt is "-374.2" // actually '-374.20001'
FloatToStr(ff2, txt); // txt is "123.4567" // actually '123.45678'
FloatToStr(ff3, txt); // txt is "1.234e-6" // actually '0.00000' (still so in v4.60)'
Also, the longest string (txt) needed was of length 10, why is it specified as 23?