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 3:52AM
    Try so:

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

    THANKS!

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.