public void LoadAveragePingTime()
{
try
{
PingReply pingReply = pingClass.Send("logon.chronic-domination.com");
double AveragePing = (pingReply.RoundtripTime / 1.75);
label4.Text = (AveragePing.ToString() + "ms");
}
catch (Exception)
{
label4.Text = "Server is currently offline.";
}
}
Currently my label4.Text get's something like: "187.371698712637".
I need it to show something like: "187.37"
Only two posts after the DOT. Can someone help me out?
string.Format
is your friend.
String.Format("{0:0.00}", 123.4567); // "123.46"