String format with positive sign

InertiaM

Well-known member
Joined
Nov 3, 2007
Messages
663
Location
Kent, UK
Programming Experience
10+
Is there a character I can use in a String.Format method that will return either a negative '-' or positive '+' sign? I have to create a string with 8 values to send to a printer, which looks something like :-

VB.NET:
Z2;2,+000+000+00-450+00+00-00-000000

All of the values may be negative or positive. I know I can loop all the variables with IF..THEN..ELSE to give me the sign, but this just seems tedious :(
 
:D

Note to self - always scroll to the bottom of MSDN articles. I read the 2005 version (where the examples are at the bottom) as opposed to the 2008 version where the examples are included at the relevant point. Needless to say, I didnt scroll down to the bottom :eek:
 
Back
Top