• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 320
  • Last Modified:

Change number format

I am running a vb script that saves to a csv file. I have a number that is coming over with comas included so it is causing problems when I open it  up in excel. Can anyone tell me how to format this so that it still works the same but the output of fsize does not have any commas?

thanks for your help!


If InStr(strText,"Size:         ")>0 Then
            fsize=Replace(strText,"Size:         ","")
            fsize=Replace(fsize," bytes","")
            fsizedbl=CDbl(fsize)
           ' WScript.Echo "File size " & fsizedbl
            outputfile.WriteLine strcomputer & "," & folder & "," &  fsize
            Exit Do
        End If

Open in new window

0
CCG3
Asked:
CCG3
  • 2
1 Solution
 
Mechanic_KharkovCommented:
outputfile.WriteLine strcomputer & "," & folder & "," &  Replace(fsize, ",", ".")  ' ?

Open in new window

0
 
CCG3Author Commented:
I changed it to this.. but now it looks like it works fine for me.
outputfile.WriteLine strcomputer & "," & folder & "," &  Replace(fsize, ",", "")  '

Open in new window

0
 
Mechanic_KharkovCommented:
:-) Sorry, I've thought that comma is decimal separator. In my place (Ukraine) decimal separator is usually comma, but some software uses a dot instead. But if you have commas as thousands separator, then there is really no need to replace them with dots.
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now