You need to prefix something with the retrieved amount (Positive, negative, zeros). How will you handle this?

 Posted by Bhakti on 12/14/2009 | Category: ASP.NET Interview questions | Views: 2370
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 

Comments or Responses

Login to post response