[jQuery] Re: sorting values with commas with tablesorter 2.0
I know a while back I was trying to sort percentages and they weren't working. That's because the percentages I had to sort were of the format xx.yy%. The parser for percent in tableSorter only handled them if they were of the format xx%. I ended up modifying the parser for percent to handle xx.yy% with as many y's as you wanted. So it now sorts 80%, 80.1%, 80.01% etc etc etc. In retrospect, I suppose I could have stripped out the '.' and then sorted it... *shrug*
[jQuery] Re: sorting values with commas with tablesorter 2.0
Or simply function (s) { return s.replace(/,/g, ""); } On Jan 24, 1:16 pm, Bhaarat Sharma <[EMAIL PROTECTED]> wrote: > got it > > for anyone ahving same trouble.. > > format: function(s) { > while (s.indexOf(",")>0) > s = s.substring(0,s.indexOf(",")) > +s.substring(s.indexOf(",")+1,s.length); > return s; > }, > > On Jan 24, 12:04 pm, Bhaarat Sharma <[EMAIL PROTECTED]> wrote: > > > noticed i had before the data inside the tags. > > > but still not able to sort number withcommas. like 1642 as 1,642 > > > thanks! > > > On Jan 24, 11:51 am, Bhaarat Sharma <[EMAIL PROTECTED]> wrote: > > > > now i notice that even simple numbers are not sorted correctly. > > > > i am displaying these numbers from a scriplet <%=object.displayLong() > > > %> do i need to be converting this to a string or tableSorter to work > > > correctly. > > > > only data that is in a percentage is being displayed property. like > > > 00.01% and 00.55% > > > > What aM i doing wrong! > > > > hopefully someone can come to rescue. I've spent a lot of time in > > > getting tableSorter to work and now noticing sorting error s:( > > > > On Jan 24, 11:36 am, Bhaarat Sharma <[EMAIL PROTECTED]> wrote: > > > > > anything? > > > > > this data is directly in a th header. 3,567 and isnt sorting > > > > properly. > > > > > would appreciate some tips > > > > > On Jan 23, 5:20 pm, Bhaarat Sharma <[EMAIL PROTECTED]> wrote: > > > > > > Hi > > > > > > I have some number which have commos in them. How can i sort these > > > > > propertly? > > > > > > for example 3567 is as 3,567
[jQuery] Re: sorting values with commas with tablesorter 2.0
got it for anyone ahving same trouble.. format: function(s) { while (s.indexOf(",")>0) s = s.substring(0,s.indexOf(",")) +s.substring(s.indexOf(",")+1,s.length); return s; }, On Jan 24, 12:04 pm, Bhaarat Sharma <[EMAIL PROTECTED]> wrote: > noticed i had before the data inside the tags. > > but still not able to sort number with commas. like 1642 as 1,642 > > thanks! > > On Jan 24, 11:51 am, Bhaarat Sharma <[EMAIL PROTECTED]> wrote: > > > now i notice that even simple numbers are not sorted correctly. > > > i am displaying these numbers from a scriplet <%=object.displayLong() > > %> do i need to be converting this to a string or tableSorter to work > > correctly. > > > only data that is in a percentage is being displayed property. like > > 00.01% and 00.55% > > > What aM i doing wrong! > > > hopefully someone can come to rescue. I've spent a lot of time in > > getting tableSorter to work and now noticing sorting error s:( > > > On Jan 24, 11:36 am, Bhaarat Sharma <[EMAIL PROTECTED]> wrote: > > > > anything? > > > > this data is directly in a th header. 3,567 and isnt sorting > > > properly. > > > > would appreciate some tips > > > > On Jan 23, 5:20 pm, Bhaarat Sharma <[EMAIL PROTECTED]> wrote: > > > > > Hi > > > > > I have some number which have commos in them. How can i sort these > > > > propertly? > > > > > for example 3567 is as 3,567
[jQuery] Re: sorting values with commas with tablesorter 2.0
noticed i had before the data inside the tags. but still not able to sort number with commas. like 1642 as 1,642 thanks! On Jan 24, 11:51 am, Bhaarat Sharma <[EMAIL PROTECTED]> wrote: > now i notice that even simple numbers are not sorted correctly. > > i am displaying these numbers from a scriplet <%=object.displayLong() > %> do i need to be converting this to a string or tableSorter to work > correctly. > > only data that is in a percentage is being displayed property. like > 00.01% and 00.55% > > What aM i doing wrong! > > hopefully someone can come to rescue. I've spent a lot of time in > getting tableSorter to work and now noticing sorting error s:( > > On Jan 24, 11:36 am, Bhaarat Sharma <[EMAIL PROTECTED]> wrote: > > > anything? > > > this data is directly in a th header. 3,567 and isnt sorting > > properly. > > > would appreciate some tips > > > On Jan 23, 5:20 pm, Bhaarat Sharma <[EMAIL PROTECTED]> wrote: > > > > Hi > > > > I have some number which have commos in them. How can i sort these > > > propertly? > > > > for example 3567 is as 3,567
[jQuery] Re: sorting values with commas with tablesorter 2.0
now i notice that even simple numbers are not sorted correctly. i am displaying these numbers from a scriplet <%=object.displayLong() %> do i need to be converting this to a string or tableSorter to work correctly. only data that is in a percentage is being displayed property. like 00.01% and 00.55% What aM i doing wrong! hopefully someone can come to rescue. I've spent a lot of time in getting tableSorter to work and now noticing sorting error s:( On Jan 24, 11:36 am, Bhaarat Sharma <[EMAIL PROTECTED]> wrote: > anything? > > this data is directly in a th header. 3,567 and isnt sorting > properly. > > would appreciate some tips > > On Jan 23, 5:20 pm, Bhaarat Sharma <[EMAIL PROTECTED]> wrote: > > > Hi > > > I have some number which have commos in them. How can i sort these > > propertly? > > > for example 3567 is as 3,567
[jQuery] Re: sorting values with commas with tablesorter 2.0
anything? this data is directly in a th header. 3,567 and isnt sorting properly. would appreciate some tips On Jan 23, 5:20 pm, Bhaarat Sharma <[EMAIL PROTECTED]> wrote: > Hi > > I have some number which have commos in them. How can i sort these > propertly? > > for example 3567 is as 3,567