Answer: In such case you can use, custom numeric format string.
Example given below can make it clearer.
Dim num As Double
num = 100
Dim MyString As String = num.ToString("Test positive : #,##0.00;")
num = -100
MyString = num.ToString(";Test negative : [ $#,##0.00 ]")
num = 0
MyString = num.ToString(";;It's zero. :( :( ")
Asked In: Many Interviews |
Alert Moderator