Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / New Users / April 2006

Tip: Looking for answers? Try searching our database.

Format

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Wallace - 22 Apr 2006 10:36 GMT
Hai All,

 I am working in asp.net...
 I need to format a number in the following manner...

  number  = 500

  After formatting i need the number as string as "     500"

  that is 5 spaces before number...

  If give the number as 2, then i should get as "       2"  i.e 7
spaces before the number..

  how can format like this??

  Please reply...

  Looking forward for the response...

  Thanx in advance.....
Mattias Sjögren - 22 Apr 2006 12:20 GMT
>   how can format like this??

number.ToString().PadLeft(8)

Mattias

Signature

Mattias Sjögren [C# MVP]  mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.

Kevin Spencer - 22 Apr 2006 14:29 GMT
This is the 3rd newsgroup I've seen this question posted in. Now, let me
explain why this is bad Netiquette:

In another newsgroup where you posted this exact same question, it was
answered, and you thanked the person who took the time to give you the
answer. However, in another newgroup where you posted this exact same
question, it has not been answered yet. In this newsgroup, another person
took the time to answer your question, but you have not thanked this person,
apparently because you have gone on your merry way (in fact, I doubt that
you will read *this* response; I am writing it for the benefit of everyone).

Note that I used the phrase "took the time" with regards to the people who
answered your question. It takes time, sometimes a good bit of time, to
anwer a question in these newsgroups, and almost none of us get paid for it.
I don't know how valuable your time is to you, but to most of us, it is
quite valuable.

So, by posting this question to multiple newsgroups, you have cost people
unnecessary expenditure of their time to answer a question to which you
already have the answer, simply because it is *not* yet answered in these
other newsgroups. In other words, by your attempt to serve yourself by doing
this, you have done a disservice to everyone else.

I hope this was not intentional, and that, after reading this, you will
understand why you should *never* cross-post or multi-post questions. It
amounts to a form of selfishness that is anti-social and harmful to the
community at large. Remember that the "community at large" includes
yourself. If you are willing to make the "community at large" suffer, you
are, in effect, giving permission for others to make you suffer as well.

Signature

HTH,

Kevin Spencer
Microsoft MVP
Professional Numbskull

Hard work is a medication for which
there is no placebo.

> Hai All,
>
[quoted text clipped - 17 lines]
>
>   Thanx in advance.....

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.