Public Shared Function IndianFormatObj(ByVal obj As Object) As String
If IsDBNull(obj) Or obj.ToString = "" Then
Return ""
End If
If obj.ToString.Trim > "" And (Not IsNumeric(obj.ToString.Trim)) Then
Return obj.ToString.Trim
End If
Dim isNegitive As Boolean = False
Dim dec As Decimal = 0
dec = CDec(obj)
If dec < 0 Then
isNegitive = True
End If
Dim str As String
str = Replace(Format(dec, "##-##-##-##-##-##-##0.00"), "-", ",").Trim(",".ToCharArray)
If isNegitive Then
Return "-" & str
Else
Return str
End If
End Function
No comments:
Post a Comment