After decimal only two digit required

Hi I want After decimal only two digit required
eg
if value is 123.456789 then I want 123.46 if the after decimal third digit is greater then five then add one
if value is 123.454789 then I want 123.45 if the after decimal third digit is less then five then no change in value

If value is a Double type variable holding your value, then value.ToString("D2") will format it with 2 decimal places as a string. If value is a String type, use CDbl(value).ToString("D2").

2 Likes