Dim filesize As Double = fi.Length / 1024

If filesize > 1024 Then
filesize = filesize / 1024
filesize = Format$(filesize, "0.00")
Label2.Text = filesize.ToString & " MB"
end if


I am problem using the Format$ function....
when i code filesize = Format$(filesize, "0.00")
then my program I have a error on the Form Class......saying missing
exception method...

but when I take code the filesize = format$(filesize, "0.00")...then no
problem....

I need to format all number to 2 decimal one, are they other work around to
format the number ?

weird thing was that...i had no problem to compile that yesterday....jsut
today morning, i do not know how com that format did not work......
I have search on the web, i found that format$ is supported in
vb.net....perhaps, someone could guide me...

thank you very much

Re: Question on --- Format$(xxx, "0.00") by ctacke/>

ctacke/>
Wed Mar 09 21:51:28 CST 2005

Why not use the correct .Net method: String.Format?

There are plenty of samples on the web.

-Chris


" A_PK" <pk999@hotmail.com> wrote in message
news:elj7avRJFHA.3960@TK2MSFTNGP09.phx.gbl...
> Dim filesize As Double = fi.Length / 1024
>
> If filesize > 1024 Then
> filesize = filesize / 1024
> filesize = Format$(filesize, "0.00")
> Label2.Text = filesize.ToString & " MB"
> end if
>
>
> I am problem using the Format$ function....
> when i code filesize = Format$(filesize, "0.00")
> then my program I have a error on the Form Class......saying missing
> exception method...
>
> but when I take code the filesize = format$(filesize, "0.00")...then no
> problem....
>
> I need to format all number to 2 decimal one, are they other work around
> to format the number ?
>
> weird thing was that...i had no problem to compile that yesterday....jsut
> today morning, i do not know how com that format did not work......
> I have search on the web, i found that format$ is supported in
> vb.net....perhaps, someone could guide me...
>
> thank you very much
>