Also you can try this function DoubleStripDigits(a:Double;dig:integer):String; begin // because format rounds, add 2 more digits then wanted result := format('%.*f',[dig+2, a]); // and then cut them result := copy(result,1,length(result)-2); end;
calling as DoubleStripDigits(a,2) to have as string or StrToFloatDef(DoubleStripDigits(a,2),0) to have it as double *********** REPLY SEPARATOR *********** >Arsen Khachatryan wrote: > > Hello world how are you. > Im doing calculation in my delphi program for example im calculating > 7751.9 / 2991 and geting result 2,57970578401872 how can I cut after > 2.5 that its calculate like this 7751.9/2991 = 2.5 and not > 2,57970578401872 > **************************************