javascript_howto thread: Re: [javascript_howto]how can i convert -1 to 1 in javascript
This is a multi-part message in MIME format.
------=_NextPart_000_0047_01C22363.A79B4320
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
thanks ponna
pawan
----- Original Message -----
From: Ponna reddy
To: JavaScript HowTo
Sent: Wednesday, July 03, 2002 9:59 PM
Subject: [javascript_howto] Re: [javascript_howto]how can i convert -1
to 1 injavascript
Hi Pawan,
To get the positive Numbe always, what ever is the Number use the
following code in JavaScript.
-------------------------------------------------------------------------
-------------------
var j =3D -2;
var i =3D 2;
alert( Math.abs(j) + ' ' + Math.abs (i));
-------------------------------------------------------------------------
--------------------
Have a good day.
Thanks,
Veera
Veera R Ponna
There is never enough time, unless you're serving it.
>From: "Pawan Gupta"
>Reply-To: "JavaScript HowTo"
>To: "JavaScript HowTo"
>Subject: [javascript_howto] Re: [javascript_howto]how can i convert
-1 to 1 in javascript
>Date: Wed, 3 Jul 2002 14:18:25 +0530
>
>thanks Terrence
>
>i understand you point
>
>what happen when i use 3 (positive no.) i.e my main aim to convert
any
>number to positive number
>i.e
>
>-(Anum) to Anum
>
>Anum may be positive or negative
>
>i hope you understand my point
>
>pawan
>
>
>----- Original Message -----
>From: Terrence Joubert
>To: JavaScript HowTo
>Sent: Wednesday, July 03, 2002 1:41 PM
>Subject: [javascript_howto] Re: [javascript_howto]how can i convert
-1 to 1
>in javascript
>
>
> > Pawan,
> >
> > Basic Arithmetic Rule: Any negative number divided by -1 will
produce the
> > positive value for that number.
> > -3 / -1 =3D 3
> > -4 / -1 =3D 4
> > -5 / -1 =3D 5
> > -6 / -1 =3D 6
> >
> > Hope this helps.
> > Terrence
> >
> > -----Original Message-----
> > From: Pawan Gupta [mailto:pawan.gupta@i...]
> > Sent: Wednesday, July 03, 2002 12:12 PM
> > To: JavaScript HowTo
> > Subject: [javascript_howto] Re: [javascript_howto]how can i
convert -1 to
>1
> > in javascript
> >
> > hi Terrence
> > is there any function which convert -2 to 2
> >
> > pawan
> >
> > ----- Original Message -----
> > From: Terrence Joubert
> > To: JavaScript HowTo
> > Sent: Wednesday, July 03, 2002 12:58 PM
> > Subject: [javascript_howto] Re: [javascript_howto]how can i
convert -1 to
>1
> > in javascript
> >
> >
> > >
> > > -1 / -1
> > >
> > > / is division. Works OK for all negative numbers.
> > >
> > > Terrence
> > >
> > > -----Original Message-----
> > > From: Pawan Gupta [mailto:pawan.gupta@i...]
> > > Sent: Wednesday, July 03, 2002 11:31 AM
> > > To: JavaScript HowTo
> > > Subject: [javascript_howto] Re: [javascript_howto]how can i
convert -1
>to
> > 1
> > > in javascript
> > >
> > > hi to all
> > >
> > > how can i convert -1 to 1 in javascript
> > >
> > > thanks in advance
> > >
> > > pawan
> > >
> > >
> > >
> > >
> > >
> > >
> > > ---
> > >
> > > Improve your web design skills with these new books from
Glasshaus.
> > >
> > > Usable Web Menus
> > >
http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=3Dnosim/theprogramm
e
> > > r-20
> > > Constructing Accessible Web Sites
> > >
http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=3Dnosim/theprogramm
e
> > > r-20
> > > Practical JavaScript for the Usable Web
> > >
http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=3Dnosim/theprogramm
e
> > > r-20
> > >
> > >
> > > ---
> > >
> > > Improve your web design skills with these new books from
Glasshaus.
> > >
> > > Usable Web Menus
> > >
http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=3Dnosim/theprogramm
e
> > > r-20
> > > Constructing Accessible Web Sites
> > >
http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=3Dnosim/theprogramm
e
> > > r-20
> > > Practical JavaScript for the Usable Web
> > >
http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=3Dnosim/theprogramm
e
> > > r-20
> > >
> > >
> >
> >
> >
> >
> > ---
> >
> > Improve your web design skills with these new books from
Glasshaus.
> >
> > Usable Web Menus
> >
http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=3Dnosim/theprogramm
e
> > r-20
> > Constructing Accessible Web Sites
> >
http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=3Dnosim/theprogramm
e
> > r-20
> > Practical JavaScript for the Usable Web
> >
http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=3Dnosim/theprogramm
e
> > r-20
> >
> >
> > ---
> >
> > Improve your web design skills with these new books from
Glasshaus.
> >
> > Usable Web Menus
> >
http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=3Dnosim/theprogramm
e
> > r-20
> > Constructing Accessible Web Sites
> >
http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=3Dnosim/theprogramm
e
> > r-20
> > Practical JavaScript for the Usable Web
> >
http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=3Dnosim/theprogramm
e
> > r-20
> >
> >
>
>
>
>
>---
>
>Improve your web design skills with these new books from Glasshaus.
>
>Usable Web Menus
>http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=3Dnosim/theprogram
me
>r-20
>Constructing Accessible Web Sites
>http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=3Dnosim/theprogram
me
>r-20
>Practical JavaScript for the Usable Web
>http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=3Dnosim/theprogram
me
>r-20
-------------------------------------------------------------------------
-----
Chat with friends online, try MSN Messenger: Click Here
--- Improve your web design skills with these new books from
Glasshaus. Usable Web Menus
http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=3Dnosim/theprogramm
e r-20 Constructing Accessible Web Sites
http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=3Dnosim/theprogramm
e r-20 Practical JavaScript for the Usable Web
http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=3Dnosim/theprogramm
e r-20 --- Change your mail options at http://p2p.wrox.com/manager.asp
or