Skip to content

Commit

Permalink
docs : use parseFloat for weight sorting data. Resolves #5
Browse files Browse the repository at this point in the history
  • Loading branch information
desandro committed Feb 8, 2011
1 parent d6e00f2 commit 09bddb7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion _layouts/elements.html
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ <h3>Etc</h3>
return parseInt( $elem.find('.number').text(), 10 );
},
weight : function( $elem ) {
return parseInt( $elem.find('.weight').text().replace( /[\(\)]/g, ''), 10 );
return parseFloat( $elem.find('.weight').text().replace( /[\(\)]/g, '') );
},
name : function ( $elem ) {
return $elem.find('.name').text();
Expand Down
2 changes: 1 addition & 1 deletion _posts/demos/2010-12-30-sorting.html
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
return parseInt( $elem.find('.number').text(), 10 );
},
weight : function( $elem ) {
return parseInt( $elem.find('.weight').text().replace( /[\(\)]/g, ''), 10 );
return parseFloat( $elem.find('.weight').text().replace( /[\(\)]/g, '') );
},
name : function ( $elem ) {
return $elem.find('.name').text();
Expand Down

0 comments on commit 09bddb7

Please sign in to comment.