Formating values

Hello!

I have samo troubles with formating values, witch I calculate in the report. Example:

var
st1, st2, st3: Extended;
begin
st1 := 10;
st2 := 3;
st3 := st1/st2;
mmResult.Text := FloatToStr(st3);
end;

with number format %2.2n of the TextObject returns 3,33333333333333 instead of 3,33.

What do I do wrong?

Thanks

Comments

  • edited 9:06AM
    Try so:

    mmResult.Text := FormatFloat('##.##',st3);
  • edited 9:06AM
    I was looking for ('#,###.#0',st3) but You lead me to the right answer.

    THANKS!

Leave a Comment