Home All Groups Group Topic Archive Search About

Trailing minus in display

Author
13 Feb 2006 4:44 PM
DaveO.
Hello,

Is there a simple/standard way to display a negative number (integer in
this case) with a trailing minus sign? I've looked in help on
formatting, but I don't see a way to do it.

I'm actually on .NET Compact Framework, but this seemed more like a VB
question.


Thanks,
DaveO.

Author
13 Feb 2006 7:10 PM
alantolan
You can try custom formats for the ToString() function.

e.g.
    Dim num As Integer = -17
    MessageBox.Show(num.ToString("00;00-"))


Check out the custom format strings on ToString() in the help for more
details

hth,
Alan.