Formatting numbers in a repeater control

My output of number in my repeater control displays as for example 1000 and I prefer with a comma as 1,000

here's the code..

                 <td>
                                                <asp:Label ID="lblActMin" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "ACTUAL_MINIMUM")%>'></asp:Label>


                                            </td>

Open in new window

zachvaldezAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Ryan ChongBusiness Systems Analyst , ex-Senior Application EngineerCommented:
you can write and then call the “custom function” to format the output.
0
zachvaldezAuthor Commented:
May I request for the code that formats it please?
0
zachvaldezAuthor Commented:
                              <td>
                                   <asp:Label ID="lblActMin" runat="server" Text='<%# DataBinder.Eval (Container.DataItem, "ACTUAL_MINIMUM")%>'></asp:Label>


                                            </td>

Open in new window


I just want to format the text to display as 1,000.00 and not 1000.00
0
Python 3 Fundamentals

This course will teach participants about installing and configuring Python, syntax, importing, statements, types, strings, booleans, files, lists, tuples, comprehensions, functions, and classes.

zachvaldezAuthor Commented:
As I do not get a response, can the admin just delete this question please?
0
Ryan ChongBusiness Systems Analyst , ex-Senior Application EngineerCommented:
sorry as was away for quite some time...

try:

<%# Eval("ACTUAL_MINIMUM", "{0:#,0.00}") %>

Open in new window


or create a custom function like:

<%# Format(Eval("ACTUAL_MINIMUM")) %>

Open in new window


then:

protected string Format(object v)
        {
            return ((decimal)v).ToString("#,0.00");
        }

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
zachvaldezAuthor Commented:
that wad great! thanks
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
C#

From novice to tech pro — start learning today.