Simple formatting question...

Discussion in 'ASP .Net' started by The Eeediot, Nov 22, 2004.

  1. The Eeediot

    The Eeediot Guest

    How do I get a number like "131" to appear in a currency format like "$131.00" in a TextBox control?

    I know it's simple but I cannot find how to do this in any reference manual.

    TIA....
    The Eeediot, Nov 22, 2004
    #1
    1. Advertising

  2. add a maskedEdite control and set the format you want
    to add this rigth clik toolbox and choose customise toolbox you will find
    this control

    "The Eeediot" wrote:

    > How do I get a number like "131" to appear in a currency format like "$131.00" in a TextBox control?
    >
    > I know it's simple but I cannot find how to do this in any reference manual.
    >
    > TIA...
    =?Utf-8?B?c2FyYQ==?=, Nov 22, 2004
    #2
    1. Advertising

  3. The Eeediot

    The Eeediot Guest

    Hmmm.

    That might work if I were using Visual Studio.NET but I'm using Web Matrix.

    I ended up improvising by using:

    txtTotalSalesYTD.Text = "$" & String.Format("{0:F2}",
    CDbl(dreader("TotalSales")))

    "sara" <> wrote in message
    news:...
    > add a maskedEdite control and set the format you want
    > to add this rigth clik toolbox and choose customise toolbox you will find
    > this control
    >
    > "The Eeediot" wrote:
    >
    > > How do I get a number like "131" to appear in a currency format like

    "$131.00" in a TextBox control?
    > >
    > > I know it's simple but I cannot find how to do this in any reference

    manual.
    > >
    > > TIA...
    The Eeediot, Nov 22, 2004
    #3
  4. Tostring takes standard formatting, so slightly simpler:
    cdbl(dreader("TotalSales")).tostring("c")

    Bill

    "The Eeediot" wrote:

    > Hmmm.
    >
    > That might work if I were using Visual Studio.NET but I'm using Web Matrix.
    >
    > I ended up improvising by using:
    >
    > txtTotalSalesYTD.Text = "$" & String.Format("{0:F2}",
    > CDbl(dreader("TotalSales")))
    >
    > "sara" <> wrote in message
    > news:...
    > > add a maskedEdite control and set the format you want
    > > to add this rigth clik toolbox and choose customise toolbox you will find
    > > this control
    > >
    > > "The Eeediot" wrote:
    > >
    > > > How do I get a number like "131" to appear in a currency format like

    > "$131.00" in a TextBox control?
    > > >
    > > > I know it's simple but I cannot find how to do this in any reference

    > manual.
    > > >
    > > > TIA...

    >
    >
    >
    =?Utf-8?B?QmlsbCBCb3Jn?=, Nov 22, 2004
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Chris
    Replies:
    1
    Views:
    317
    Michael Pearson
    Jan 3, 2004
  2. xarax
    Replies:
    5
    Views:
    360
    Jon A. Cruz
    Aug 29, 2003
  3. Steven D'Aprano

    Simple string formatting question

    Steven D'Aprano, Apr 6, 2006, in forum: Python
    Replies:
    7
    Views:
    272
    Peter Otten
    Apr 7, 2006
  4. Replies:
    1
    Views:
    401
    Joseph Kesselman
    Jun 7, 2007
  5. Neal Becker

    simple string formatting question

    Neal Becker, Dec 14, 2007, in forum: Python
    Replies:
    2
    Views:
    232
    Neil Cerutti
    Dec 14, 2007
Loading...

Share This Page