Formate the value to show two digit after decimal.

mohanarajmohanaraj 600001
edited 11:38PM in FastReport .NET
Dear Alex,

In my report i want to show the value as like

total1 = 100.00
total2 = 101.20

but it shown as


total1 = 100
total2 = 101.2

How i achieve this in my report i use format the text object as

TextObject1.Text = "[Currency]" + string.Format("{0:#,##0.00}", "[TotalInc]");

[Currency] => this parameter for show the currency symbol.
[TotalInc] => total value.

in this which is wrong how can i solve this ?

Thanks in advance.

Comments

  • edited 11:38PM
    Hello,

    Right-click the Text object and select "Format...". Then select Number formatting.
  • mohanarajmohanaraj 600001
    edited 11:38PM
    AlexTZ wrote: »
    Hello,

    Right-click the Text object and select "Format...". Then select Number formatting.


    Dear Alex,

    I bound this text object by program.

    thanks.
  • edited 11:38PM
    Try to set

    TextObject1.Format = new FastReport.Format.NumberFormat();
  • edited 11:38PM
    Hi Alex,

    Under the same circumstances,

    the number is displayed as say - 152653.00
    but I want to display as - 1,52,653.00.


    Thanks in advance.

  • edited 11:38PM
    Hello,

    You need to write own script function that does such formatting. You may call it in the Text object then:

    [MyFunc(152653)]
  • edited July 2010
    I have been searching answers for this kind of problem. i am thankful for putting your concerns in this forums and my problem was finally solved . have a great day.
  • edited 11:38PM
    AlexTZ wrote: »
    Hello,

    You need to write own script function that does such formatting. You may call it in the Text object then:

    [MyFunc(152653)]

    Hi Alex,

    I tried but could not figure out how.

    Can you give some code examples.

    Thanks
  • edited 11:38PM
    Hi Alex,

    I have found a way.

    text1.Text = String.Format("{0:0,0.00}", debitBalance);

    Thank You.
    >
  • edited July 2010
    Yes, that parameter shows the currency. But you need to have a formula to solve it. This will help you lessen or lighten your job as well.

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.