Anyone able to tell me if there's an alternative to the Format function that
VB has? (it appears ASP doesn't support it)
I'm basically (and believe me, I know how stupid this is going to sound)
trying to find a way of getting a file/folder's size to show in something
other than bytes (i.e. KB or MB, depending on what size it is).
I've tried modifying some of my VB functions to ASP compatable, but it
doesn't seem to like them.
E.G. in VB, I use;
something = Format((Fldr.Size / 1024), "#0.00") & " KB"
or
Format((Fldr.Size / 1024) / 1024, "##0.00") & " MB"
Neither of the above seem to work as below;
Response.Write Format((Fldr.Size / 1024) / 1024, "##0.00") & " MB"
--
Regards
Steven Burn
Ur I.T. Mate Group www.it-mate.co.uk
Keeping it FREE!
Disclaimer:
I know I'm probably wrong, I just like taking part ;o) 7 3996
"Steven Burn" <nobody@PVT_it-mate.co.uk> wrote in message
news:uQ**************@TK2MSFTNGP09.phx.gbl... Anyone able to tell me if there's an alternative to the Format function
that VB has? (it appears ASP doesn't support it)
I'm basically (and believe me, I know how stupid this is going to sound) trying to find a way of getting a file/folder's size to show in something other than bytes (i.e. KB or MB, depending on what size it is).
I've tried modifying some of my VB functions to ASP compatable, but it doesn't seem to like them.
E.G. in VB, I use;
something = Format((Fldr.Size / 1024), "#0.00") & " KB"
Why not simply perform the math operation (without the Format command) on a
variable, and then Response.Write it with "KB" appended as a string?
R.
Steven Burn wrote: Anyone able to tell me if there's an alternative to the Format function that VB has? (it appears ASP doesn't support it)
It's vbscript that doesn't support it (ASP is not a language). http://msdn.microsoft.com/library/en...onfeatures.asp I'm basically (and believe me, I know how stupid this is going to sound) trying to find a way of getting a file/folder's size to show in something other than bytes (i.e. KB or MB, depending on what size it is).
I've tried modifying some of my VB functions to ASP compatable, but it doesn't seem to like them.
E.G. in VB, I use;
something = Format((Fldr.Size / 1024), "#0.00") & " KB"
or
Format((Fldr.Size / 1024) / 1024, "##0.00") & " MB"
Neither of the above seem to work as below;
Response.Write Format((Fldr.Size / 1024) / 1024, "##0.00") & " MB" http://www.aspfaq.com/show.asp?id=2313
HTH,
Bob Barrows
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
See the FormatNumber function.
You will still have to perform the division but FormatNumber can control the
number of places after the decimal point.
--
Mark Schupp
Head of Development
Integrity eLearning www.ielearning.com
"Steven Burn" <nobody@PVT_it-mate.co.uk> wrote in message
news:uQ**************@TK2MSFTNGP09.phx.gbl... Anyone able to tell me if there's an alternative to the Format function
that VB has? (it appears ASP doesn't support it)
I'm basically (and believe me, I know how stupid this is going to sound) trying to find a way of getting a file/folder's size to show in something other than bytes (i.e. KB or MB, depending on what size it is).
I've tried modifying some of my VB functions to ASP compatable, but it doesn't seem to like them.
E.G. in VB, I use;
something = Format((Fldr.Size / 1024), "#0.00") & " KB"
or
Format((Fldr.Size / 1024) / 1024, "##0.00") & " MB"
Neither of the above seem to work as below;
Response.Write Format((Fldr.Size / 1024) / 1024, "##0.00") & " MB"
-- Regards
Steven Burn Ur I.T. Mate Group www.it-mate.co.uk
Keeping it FREE!
Disclaimer: I know I'm probably wrong, I just like taking part ;o)
hehe, I've just thought of that aswell.
Haven't tried it yet, but if I'm correct, then the below should work???
Response.Write fldr.Size /1024 & " KB"
--
Regards
Steven Burn
Ur I.T. Mate Group www.it-mate.co.uk
Keeping it FREE!
Disclaimer:
I know I'm probably wrong, I just like taking part ;o)
Richard K Bethell <so*****@spammingisevil.bad> wrote in message
news:Ou**************@tk2msftngp13.phx.gbl... "Steven Burn" <nobody@PVT_it-mate.co.uk> wrote in message news:uQ**************@TK2MSFTNGP09.phx.gbl... Anyone able to tell me if there's an alternative to the Format function that VB has? (it appears ASP doesn't support it)
I'm basically (and believe me, I know how stupid this is going to sound) trying to find a way of getting a file/folder's size to show in
something other than bytes (i.e. KB or MB, depending on what size it is).
I've tried modifying some of my VB functions to ASP compatable, but it doesn't seem to like them.
E.G. in VB, I use;
something = Format((Fldr.Size / 1024), "#0.00") & " KB"
Why not simply perform the math operation (without the Format command) on
a variable, and then Response.Write it with "KB" appended as a string?
R.
Cheers
--
Regards
Steven Burn
Ur I.T. Mate Group www.it-mate.co.uk
Keeping it FREE!
Disclaimer:
I know I'm probably wrong, I just like taking part ;o)
Mark Schupp <ms*****@ielearning.com> wrote in message
news:eO**************@TK2MSFTNGP11.phx.gbl... See the FormatNumber function.
You will still have to perform the division but FormatNumber can control
the number of places after the decimal point.
-- Mark Schupp Head of Development Integrity eLearning www.ielearning.com
"Steven Burn" <nobody@PVT_it-mate.co.uk> wrote in message news:uQ**************@TK2MSFTNGP09.phx.gbl... Anyone able to tell me if there's an alternative to the Format function that VB has? (it appears ASP doesn't support it)
I'm basically (and believe me, I know how stupid this is going to sound) trying to find a way of getting a file/folder's size to show in
something other than bytes (i.e. KB or MB, depending on what size it is).
I've tried modifying some of my VB functions to ASP compatable, but it doesn't seem to like them.
E.G. in VB, I use;
something = Format((Fldr.Size / 1024), "#0.00") & " KB"
or
Format((Fldr.Size / 1024) / 1024, "##0.00") & " MB"
Neither of the above seem to work as below;
Response.Write Format((Fldr.Size / 1024) / 1024, "##0.00") & " MB"
-- Regards
Steven Burn Ur I.T. Mate Group www.it-mate.co.uk
Keeping it FREE!
Disclaimer: I know I'm probably wrong, I just like taking part ;o)
I've sorted it, thanks for the replies guys.......
Function FeckIt(florfldr)
FeckIt = formatnumber((cdbl(florfldr)/1024),0):If FeckIt < 1 then FeckIt
= 1
End Function
Response.Write FeckIt(File.Size) & " KB"
--
Regards
Steven Burn
Ur I.T. Mate Group www.it-mate.co.uk
Keeping it FREE!
Disclaimer:
I know I'm probably wrong, I just like taking part ;o)
Steven Burn <nobody@PVT_it-mate.co.uk> wrote in message
news:uQ**************@TK2MSFTNGP09.phx.gbl... Anyone able to tell me if there's an alternative to the Format function
that VB has? (it appears ASP doesn't support it)
I'm basically (and believe me, I know how stupid this is going to sound) trying to find a way of getting a file/folder's size to show in something other than bytes (i.e. KB or MB, depending on what size it is).
I've tried modifying some of my VB functions to ASP compatable, but it doesn't seem to like them.
E.G. in VB, I use;
something = Format((Fldr.Size / 1024), "#0.00") & " KB"
or
Format((Fldr.Size / 1024) / 1024, "##0.00") & " MB"
Neither of the above seem to work as below;
Response.Write Format((Fldr.Size / 1024) / 1024, "##0.00") & " MB"
-- Regards
Steven Burn Ur I.T. Mate Group www.it-mate.co.uk
Keeping it FREE!
Disclaimer: I know I'm probably wrong, I just like taking part ;o) This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: kevininstructor |
last post by:
The following was copied from a web site for learning formatting.
Dim myInt As Integer = 100
Dim FormatPrice As String = String.Format("Price = |{0,10:c }|", myInt)
Console.WriteLine(FormatPrice)...
|
by: Servé Lau |
last post by:
suppose I want to use sscanf get the functionname from a function prototype.
Is the following format string correct then?
char funcname;
char *p = "func(void)";
sscanf(p, "%s", funcname);...
|
by: Donal McWeeney |
last post by:
Hi,
Is there a way to specify on the predefined format strings like P and N that
you want displayed all the decimals in the number...
for example
3 will display 3
2.1 will display 2.1...
|
by: MM |
last post by:
Hi,
I have a param class containg these vars:-
string key; // eg: "WN"
object value; // eg: 1.2
string format; // eg "F2"
and I output these to a StreamWriter using
...
|
by: Eddy Soeparmin |
last post by:
Hi,
I need to display a DateTime field in 'mm/dd/yyyy' in a DataGrid.. On
myGrid1 - Properties - Columns - myColumn1 - Text format string:
I tried to put 'mm/dd/yyyy' in there and it displays...
|
by: James |
last post by:
vb.net 2003
i used console.writeline to output to screen.
eg
console.writeline ("test1 : " & vbtab & v_test1)
console.writeline ("test2 : " & vbtab & v_test2)
etc etc
result becomes
|
by: stathisgotsis |
last post by:
Hello everyone,
Trusting K&R2 i thought until recently that spaces are ignored in
scanf's format string. Reading arguments to the contrary confused me a
little. So i now ask:
Is...
|
by: Tony Girgenti |
last post by:
Hello.
Trying to develop VS2005, SP1 windows form VB program.
When i try a statement like below and the data is "24.95", without the
quotes of course, regPriceString equals "000000000025+" .
...
|
by: moondaddy |
last post by:
I need to format a string to it always has 2 digits in it. I'm getting the
month like this:
DateTime.Now.Month.ToString()
Right now since it's August, this returns a string of "8", however, I...
|
by: Andrus |
last post by:
How to create format string for decimal data type
which shows blank for zero and default format otherwize ?
I tried format string "f;f;#" but this shows f for nonzero numbers.
Andrus.
...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 2 August 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM)
The start time is equivalent to 19:00 (7PM) in Central...
|
by: linyimin |
last post by:
Spring Startup Analyzer generates an interactive Spring application startup report that lets you understand what contributes to the application startup time and helps to optimize it. Support for...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Sept 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM)
The start time is equivalent to 19:00 (7PM) in Central...
|
by: Taofi |
last post by:
I try to insert a new record but the error message says the number of query names and destination fields are not the same
This are my field names
ID, Budgeted, Actual, Status and Differences
...
|
by: DJRhino1175 |
last post by:
When I run this code I get an error, its Run-time error# 424 Object required...This is my first attempt at doing something like this. I test the entire code and it worked until I added this -
If...
|
by: Rina0 |
last post by:
I am looking for a Python code to find the longest common subsequence of two strings. I found this blog post that describes the length of longest common subsequence problem and provides a solution in...
|
by: lllomh |
last post by:
Define the method first
this.state = {
buttonBackgroundColor: 'green',
isBlinking: false, // A new status is added to identify whether the button is blinking or not
}
autoStart=()=>{
|
by: lllomh |
last post by:
How does React native implement an English player?
|
by: DJRhino |
last post by:
Was curious if anyone else was having this same issue or not....
I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
| |