swindmiller Posted March 3, 2015 Share Posted March 3, 2015 (edited) I have a RS object: rs.Fields.item("FreeHardDiskSpace") that outputs like this: 476938.03125 I want to convert it to Gigabytes, so to start I want to remove everything after the period, the rest I think I can handle. I am still very new to all of this and see different ways to do it but am having trouble referencing and displaying it. Right now I use this to display it: <td>Free Space: <%Response.Write(rs.fields.item("FreeHardDiskSpace").Value)%></td> Sorry but I need a little hand holding Can someone tell me how to strip everything after the period and then how to display it? I was able to accomplish what I wanted with TotalMemory which was showing "8192" by using this: <%TotalMemory = rs.fields.item("TotalMemory")/1024%><td>Total Memory: <%Response.Write(TotalMemory)%></td> Thanks, Scott Edited March 3, 2015 by swindmiller 1 Link to comment Share on other sites More sharing options...
justsomeguy Posted March 3, 2015 Share Posted March 3, 2015 If you're using VBScript, you could round the number:http://www.w3schools.com/vbscript/func_round.aspor just drop the decimal part:http://www.w3schools.com/vbscript/func_int.aspor format it another way:http://www.w3schools.com/vbscript/func_formatnumber.asp 1 Link to comment Share on other sites More sharing options...
swindmiller Posted March 3, 2015 Author Share Posted March 3, 2015 Perfect, I knew it was something simple Thanks Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now