How to show floats only 2 number after point in delphi? -


this question has answer here:

in delphi programming want show 13.45 instead of 13.45876 ,would please me? mean want manage show way of float value. best regards.

there numerous options including:

to illustrate:

{$apptype console}  uses   sysutils;  const   d: double = 13.45876;  begin   writeln(formatfloat('0.00', d));   writeln(floattostrf(d, fffixed, 16, 2));   writeln(format('%.2f', [d])); end. 

output

 13.46 13.46 13.46 

Comments

Popular posts from this blog

javascript - jquery or ashx not working -

opencv - DataType<cv::detail::deriv_type>::depth what is it used for -

python 3.x - Mapping specific letters onto a list of words -