Decimal Digit

Hello,
I have following value in my report

1.2
1
1.234

how can I show above value
when I set decimal digit to 3
I see
1.200
1.000
1.234

I found a way :
before Textbox print
I set the value with value.tostring(#.#,###)
Is there a better way?

Comments

  • edited 9:00PM
    Hello,

    If you need to print the values as they are, set format to "General". You will get the following output:

    1.2
    1
    1.234
  • edited 9:00PM
    when I set format to "General" I see

    1.200
    1.000
    1.234

    as a note : My filed type is Decimal.

  • edited 9:00PM
    I've checked it in the "Groups" demo report. The UnitPrice field is of Decimal type. If I set format to General for this field, I get

    34
    62.5
    18
  • edited June 2009
    Another test case:

    Make a simple report with one text object. Create the BeforePrint event handler for this object:
        private void Text1_BeforePrint(object sender, EventArgs e)
        {
          decimal d = 1.2m;
          Text1.Text = d.ToString();
        }
    

    What do you see when you run a report? I see

    1.2
  • edited June 2009
    I see 1.2 and
    in demo I see correct format

    but when Assign my dataset or create a new report with Sql script
    if I have decimal field, encounter same problem
    (if I select custom format to #,0.#### it works )
  • edited 9:00PM
    When you insert a decimal data column into your report (by dragging a data column from the "Data" window), FastReport automatically sets the format for the new text object to "Currency". In your case, you need to set it to General.

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.