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 / Compact Framework / January 2006

Tip: Looking for answers? Try searching our database.

string.Format - force "+"

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Hilton - 08 Jan 2006 10:39 GMT
Hi,

I'm sure this is simple, but I cannot seem to find it:

I need:
1.  The sign to always be shown
2.  The thousand "," separator

I'm currently using {0:N} for the thousand separator, how to I force it to
show "-1,234" and "+1,234"; i.e. the "+" sign when positive.

Thanks,

Hilton
Sergey Bogdanov - 08 Jan 2006 13:29 GMT
Try this:

String.Format("{0:+0,0;-0,0}", 1234);

--
Sergey Bogdanov [.NET CF MVP, MCSD]
http://www.sergeybogdanov.com

> Hi,
>
[quoted text clipped - 10 lines]
>
> Hilton
Hilton - 09 Jan 2006 17:06 GMT

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.