bidllc
Newbie
Posts: 1
Registered: 9/22/2005
Member Is Offline
|
| posted on 9/22/2005 at 09:17 PM |
|
|
custom sorting function help
I have a column holding data in the format:
10 (33%)
12(36%)
5(3%)
I've written a function that strips the number in parens:
function sort(a)
{
var re = new RegExp("(.*)", "g");
return = Number(a.replace(re,""));
}
and referenced it properly. It works, except it appears to treat the value as a string sorting like this
1
2
30
4
55
6
Is there a way to get the result treated as a number??
|
|
|
|