replace with ","

Results 1 to 2 of 2

Thread: replace with ","

  1. #1
    Join Date
    Dec 1969

    Default replace with ","

    Hi,<BR>With the below code i can display the file properties. when i display the filesize it is displaying without any "," say if the file size is 2,346 KB it is displaying as 2346. How can i insert a "," if it is morethan 1000 KB.<BR><BR>this is my code and any help is much appreciated.<BR><BR>&#060;%<BR>folderspec = "courselists/"<BR>Set fs = CreateObject("Scripting.FileSystemObject")<BR>Set folder = fs.GetFolder(server.mappath(folderspec))<BR><BR>Se t filelist = folder.files<BR><BR>For Each File in filelist<BR>MyStrR = Right(, 3) <BR>If MyStrR = "DOC" or MyStrR = "TXT" or MyStrR = "doc" or MyStrR = "txt" then<BR> response.write "&#060;A HREF=&#039;"<BR> response.write folderspec &<BR> response.write "&#039;&#062;"<BR> sSize = round(left(file.size / 1000, 4))<BR> response.write & " - " & sSize & " KB"<BR> response.write "&#060;/A&#062;<BR>"<BR>End if<BR><BR>Next<BR><BR>set filelist=nothing<BR>set fs=nothing<BR><BR>%&#062;<BR><BR>cheers<BR>

  2. #2
    Join Date
    Dec 1969

    Default Look in the left panel of this page...

    Click on the link labeled "VBScript Reference"<BR><BR>When that page appears, BOOKMARK IT! You&#039;ll be using it all the time, I guarantee you.<BR><BR>Then, in the list of topics on that page, click on "Functions".<BR><BR>In the list of functions that appears, click on "FormatNumber".<BR><BR>Read.<BR><BR>Lots of choices!<BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts