Ask a Question related to Dreamweaver AppDev, Design and Development.
-
e-roq777 #1
Formatting Number/String Help Needed...
Hello Friends,
I am using ASP VBScript and i am trying to format a number/string. I am
trying to get this:
5982749259825982
to look like this:
598-7492598-5982
I tried a Mid function but I keep getting a Type mismatch 'Mid' error.
Here's my code:
Dim strMyNumber
strMyNumber = "5982749259825982 "
If Len(strMyNumber) >= 8 Then
Mid(strMyNumber, 4, 1) = "-"
Mid(strMyNumber, 12, 1) = "-"
End If
Thanks for any help. :)
e-roq777 Guest
-
Formatting String in Datagrid
Hi guys, does anyone know how to format strings this way:- i have 1 column(unit_num) in my Datagrid which displays eg. "01-123" i have to... -
Number formatting?
Any convenient ways (without rolling my own) of formatting numbers to include thousands separators, e.g. 1199123 printed as "1,199,123" --... -
Number formatting in CDML
I know that there are periodically volumes written about number formatting in this group. Especially the problem of formatting money. Am I crazy... -
Formatting a number
"Audrey" <audreybmorin3@hothotmail.com> wrote in message news:002a01c34aed$018ba760$a401280a@phx.gbl... Isn't this what the format setting of... -
string formatting
I need to convert a numeric filed NUMERIC(14,3) to a string with a (european) regional currency formatting like "1.234,56". How can I achieve this,... -
Joe Makowiec #2
Re: Formatting Number/String Help Needed...
On 01 Apr 2005 in macromedia.dreamweaver.appdev, e-roq777 wrote:
Offhand, I'd guess that VBScript is assuming that strMyNumber is an> Hello Friends,
>
> I am using ASP VBScript and i am trying to format a number/string.
> I am trying to get this:
> 5982749259825982
>
> to look like this:
> 598-7492598-5982
>
> I tried a Mid function but I keep getting a Type mismatch 'Mid'
> error. Here's my code:
>
> Dim strMyNumber
> strMyNumber = "5982749259825982 "
>
> If Len(strMyNumber) >= 8 Then
> Mid(strMyNumber, 4, 1) = "-"
> Mid(strMyNumber, 12, 1) = "-"
> End If
integer. Try casting as a string (cStr):
strMyNumber = cStr(5982749259825982)
or
mid(cStr(strMyNumber),4,1) = ...
--
Joe Makowiec
[url]http://makowiec.net/[/url]
Email: [url]http://makowiec.net/email.php[/url]
Joe Makowiec Guest



Reply With Quote

