DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 2 of 2
  1. #1
    ID Guest

    Re: Formatting numbers for output


    "mike viglianco" <michael.viglianco@bankofamerica.com> wrote:
    >
    >How would you format a number to display with leading zeros?
    >For example: 19 as 0000019.
    >
    >I have done this in many languages but cant seem to find out how in VBScript.
    >
    >Thanks,
    >Mike Viglianco


    I'm looking for the same format. Is there a way to do it in JavaScript or
    ASP?

  2. #2
    Steve Berzins Guest

    Re: Formatting numbers for output

    I don't know that is there is anything 'built in', but you can spin your own
    generic string 'padder'....

    Function PadLeft(strIn, padChar, strLen)
    PadLeft = Right(String(strLen, padChar) & strIn, strLen)
    End Function

    Response.Write PadLeft(19, "0", 8)
    Response.End

    "ID" <ismael.dehoyos@crystaldecisions.com> wrote in message
    news:3b0a83fc$1@news.devx.com...
    >
    > "mike viglianco" <michael.viglianco@bankofamerica.com> wrote:
    > >
    > >How would you format a number to display with leading zeros?
    > >For example: 19 as 0000019.
    > >
    > >I have done this in many languages but cant seem to find out how in

    VBScript.
    > >
    > >Thanks,
    > >Mike Viglianco

    >
    > I'm looking for the same format. Is there a way to do it in JavaScript or
    > ASP?




Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


Top DevX Stories

Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL


Sponsored Links