View Single Post
  #2  
Old 10-08-2016, 14:38
Razor12911's Avatar
Razor12911 Razor12911 is offline
Noob
 
Join Date: Jul 2012
Location: South Africa
Posts: 3,760
Thanks: 2,192
Thanked 11,234 Times in 2,316 Posts
Razor12911 is on a distinguished road
Use this

Function FloatToStrDeci(Float: Extended; DeciCount: Integer): String;
Begin
Result:= Format('%.'+IntToStr(DeciCount)+'n', [Float]);
StringChange(Result, ',', ',');
while ((Result[Length(Result)] = '0') or (Result[Length(Result)] = ',')) and (Pos(',', Result) > 0) do
SetLength(Result, Length(Result)-1);
End;

FloatToStrDeci(Float value,The number of decimals you want)
Reply With Quote
The Following User Says Thank You to Razor12911 For This Useful Post:
buttignol (10-08-2016)