Hi mahesh,
Please refer below sample.
Code
C#
protected void Page_Load(object sender, EventArgs e)
{
string number = "1234";
string[] strArr = number.ToString().Split('.').ToArray();
string finalString = string.Empty;
if (strArr.Length > 1)
{
finalString = string.Format("{0:#,0.00}", Convert.ToDouble(number));
}
else
{
finalString = string.Format("{0:#,0}", Convert.ToDouble(number));
}
ClientScript.RegisterStartupScript(this.GetType(), "alert", "alert('" + finalString + "');", true);
}
VB.Net
Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load
Dim number As String = "1234"
Dim strArr As String() = number.ToString().Split("."c).ToArray()
Dim finalString As String = String.Empty
If strArr.Length > 1 Then
finalString = String.Format("{0:#,0.00}", Convert.ToDouble(number))
Else
finalString = String.Format("{0:#,0}", Convert.ToDouble(number))
End If
ClientScript.RegisterStartupScript(Me.GetType(), "alert", "alert('" & finalString & "');", True)
End Sub
Screenshot