Formate the value to show two digit after decimal.

mohanarajmohanaraj 600001
edited 9:29PM 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 9:29PM
    Hello,

    Right-click the Text object and select "Format...". Then select Number formatting.
  • mohanarajmohanaraj 600001
    edited 9:29PM
    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 9:29PM
    Try to set

    TextObject1.Format = new FastReport.Format.NumberFormat();
  • edited 9:29PM
    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 9:29PM
    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 9:29PM
    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 9:29PM
    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