Search the archives!
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Javascript] sort replace question
- From: paul at novitskisoftware.com (Paul Novitski)
- Subject: [Javascript] sort replace question
- Date: Tue Feb 28 11:43:03 2006
At 08:37 AM 2/28/2006, Michael Borchers wrote:
> var y = 3.5;
> var x = parseFloat(y);
>
> var z = toString(y);
> alert(z);
>
>gives out: [object Window]
At 08:42 AM 2/28/2006, Matt Barton wrote:
>var y = 3.5;
>var x = parseFloat(y);
>
>var z = y.toString();
>alert(z);
1) Don't you mean:
var z = x.toString();
so that you're converting the cleaned-up value (x) instead of the
original value (y)?
2) Because this thread is "sort replace question" I'm wondering: why
are you converting to string before sorting? Isn't your sort of
floating-point numbers working correctly?
Paul
- References:
- [Javascript] sort replace question
- From: Michael Borchers
- [Javascript] sort replace question
- From: Hassan Schroeder
- [Javascript] sort replace question
- From: Shawn Milo
- [Javascript] sort replace question
- From: Michael Borchers
- [Javascript] sort replace question
- From: Matt Barton
- [Javascript] sort replace question
- Prev by Date: [Javascript] sort replace question
- Previous by thread: [Javascript] sort replace question
- Next by thread: [Javascript] sort replace question
- Index(es):