.NETGURU
Formating numbers
Messages   Related Types
This message was discovered on ASPFriends.com 'aspngvbtovbnet' list.
Responses highlighted in red are from those people who are likely to be able to contribute good, authoratitive information to this discussion. They include Microsoft employees, MVP's and others who IMHO contribute well to these kinds of discussions.

Marcelo Areal
-- Moved from [aspngfreeforall] to [aspngvbtovbnet] by Click here to reveal e-mail address <Click here to reveal e-mail address> --

I was able to use "Format" in VB6 to format numbers. Let's say Format("123",
"0000") would return 01234. I can't do this in ASP.NET

Any ideas?

Thanks, Marcelo.

Reply to this message...
 
    
Dennis West
goto http://aspalliance.com/dotnetsolutions/getSolution.aspx?ID=235

The .NET Framework provides several format strings (specifiers) that you
can use to format the appearance of strings that derive from other objects.

----- Original Message -----
From: "Marcelo Areal" <Click here to reveal e-mail address>
To: "aspngvbtovbnet" <Click here to reveal e-mail address>
Sent: Friday, March 22, 2002 10:38 AM
Subject: [aspngvbtovbnet] Formating numbers

> -- Moved from [aspngfreeforall] to [aspngvbtovbnet] by
Click here to reveal e-mail address <Click here to reveal e-mail address> --
[Original message clipped]

Reply to this message...
 
    
Mitch Denny (VIP)
Marcelo,

I'd be a bit worried if Format("123", "0000") returned
"01234", but I'll assume that was a typo. In .NET the
string class has a useful function for doing this,
here is an example:

    Dim inputString As String
    Dim outputString As String

    inputString = "123"

    outputString = String.Format("{0:0000}", inputString)

    Console.WriteLine(outputString)

As Dennis pointed out there is some quite good documentation
and its impossible to cover all the formating capabilities
in this one e-mail so I'll point you to this specific
piece of documentation in the Framework SDK.

    
ms-help://MS.NETFrameworkSDK/cpguidenf/html/cpconcustomnumericformatstri
ngs.htm

Hope this helps.

----------------------------------------
- Mitch Denny
- Click here to reveal e-mail address
- +61 (414) 610-141
-

-----Original Message-----
From: Marcelo Areal [mailto:Click here to reveal e-mail address]
Sent: Saturday, 23 March 2002 05:38
To: aspngvbtovbnet
Subject: [aspngvbtovbnet] Formating numbers

-- Moved from [aspngfreeforall] to [aspngvbtovbnet] by
Click here to reveal e-mail address <Click here to reveal e-mail address> --

I was able to use "Format" in VB6 to format numbers. Let's say
Format("123",
"0000") would return 01234. I can't do this in ASP.NET

Any ideas?

Thanks, Marcelo.

| [aspngvbtovbnet] member Click here to reveal e-mail address = YOUR ID
| http://www.asplists.com/asplists/aspngvbtovbnet.asp = JOIN/QUIT
| http://www.asplists.com/search = SEARCH Archives

Reply to this message...
 
 
System.Console
System.String




ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
Ad


Need Dot Net Interview Questions?
Ask ExamGuru, Inc. for advice and help on Passing .Net Interviews
.Net Projects
Best-of-breed application framework for .NET projects, developed by ExamGuru, Inc. and ExamGuru IT
Free .net Help
Commission ExamGuru, Inc. and his team for your next bespoke software project
FogBUGZ
The only bug tracking system carefully crafted with one goal in mind: helping teams create great software.
Awesome Tools
If you don't know about these, you're missing out... IT Certification Questions
IT Interview Questions
Free Oracle 10g Training
MCSE Boortcamp
Cisco Study Guides
Cheap Study Guides
Exact Questions
Dot Net Interview Questions
Oracle OCP
Cheap Travel
Designer Perfumes - Wholesale Prices
Free Programming Tutorials
 
ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
 Copyright © ExamGuru, Inc. 2001-2006
Contact Us - Terms of Use - Privacy Policy - www.dot-net-guru.com - www.examguru.net - www.oraclesource.net - www.itinterviews.net - www.examguru.net/ITCertification