[Javascript] removing periods (dont'run the last code I sent)
flavio
flavio at economisa.com.br
Thu Mar 11 07:15:04 CST 2004
The old one may freeze your browser..
while(TOTAL.indexOf('\.') != -1)
{ TOTAL = TOTAL.replace('\.', '') }
Citando flavio <flavio at economisa.com.br>:
>
> while(TOTAL.indexOf('.') != -1)
> {TOTAL.replace('.', '')}
>
> Question: Is there a need to 'escape' the period? (If there is, DO it. =P)
>
> Citando Håkan Magnusson <hakan at backbase.com>:
>
> > Have you tried
> >
> > TOTAL.replace(/\./, '');
> >
> > ?
> >
> > Regards,
> > H
> >
> > Paul McGuire wrote:
> >
> > > I have a string of values
> > >
> > > E.G
> > >
> > > 1.00,2.00,3.00,4.00,1.01,1.10
> > >
> > > I build this string up in a loop that reads textboxes in a form. The
> > > variable This string is then stored in is called TOTAL
> > >
> > > E.G
> > >
> > > TOTAL = "1.00,2.00,3.00,4.00,1.01,1.10"
> > >
> > > I need to be able to remove all the . from the variable TOTAL so the
> > string
> > > is.
> > >
> > > 100,200,300,400,101,110
> > >
> > > I expect a regular expression or TOTAL.replace is needed but I cant
> seem
> > to
> > > get anything to work.
> > >
> > > Thanks
> > >
> > > Paul McGuire
> > >
> > > _______________________________________________
> > > Javascript mailing list
> > > Javascript at LaTech.edu
> > > https://lists.LaTech.edu/mailman/listinfo/javascript
> > >
> > >
> > _______________________________________________
> > Javascript mailing list
> > Javascript at LaTech.edu
> > https://lists.LaTech.edu/mailman/listinfo/javascript
> >
>
>
>
>
> ---------------------------------------------------------------------
> Mensagem enviada através do WebMail NetSol (http://www.netsol.psi.br)
> _______________________________________________
> Javascript mailing list
> Javascript at LaTech.edu
> https://lists.LaTech.edu/mailman/listinfo/javascript
>
---------------------------------------------------------------------
Mensagem enviada através do WebMail NetSol (http://www.netsol.psi.br)
More information about the Javascript
mailing list