How to show floats only 2 number after point in delphi? -
this question has answer here:
- formatting float ###.## (two decimals) 2 answers
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
Post a Comment