ASP Classic how to convert bytes into KB, MB, GB, and TB.
Original Code from
converts.vbs«
The above code gives the following error.
Type mismatch on
If Size >= 1024 and on another area, notated below.
If Size >= 1024 Then suffix = " KB"Needs to be
If CDbl(trim(Size)) >= 1024 Then suffix = " KB"And
Round(Size)Needs to be
Round(CDbl(trim(Size)))So it should look like this.
To use this code, simply wrap your variable like so.
<%=ConvertSize(MyVar)%>