ToString Format

  • Thread starter Thread starter Verticon::
  • Start date Start date
V

Verticon::

Is there a way to call Integer.FormatString(format) that will return
the integer value along with its symbol?

Integer 56 should return "+56"
Integer -34 should return "-34"
 
Verticon:: said:
Is there a way to call Integer.FormatString(format) that will return
the integer value along with its symbol?

Integer 56 should return "+56"
Integer -34 should return "-34"

Use a format with separate sections for positive and negative numbers:

string s = num.ToString("+0;-0");
 
Göran,

Göran Andersson said:
Use a format with separate sections for positive and negative numbers:

string s = num.ToString("+0;-0");

.... or:

\\\
s = num.ToString("+0;-0;0")
///
 
Back
Top