|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
|
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..... > how can format like this?? number.ToString().PadLeft(8)Mattias -- Mattias Sjögren [C# MVP] mattias @ mvps.org http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com Please reply only to the newsgroup. 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. -- Show quoteHTH, Kevin Spencer Microsoft MVP Professional Numbskull Hard work is a medication for which there is no placebo. "Wallace" <princevictor.mo***@gmail.com> wrote in message news:1145698607.375364.101410@g10g2000cwb.googlegroups.com... > 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..... > |
|||||||||||||||||||||||