From 250e19107f57a62489dfdfdcf76c514cacf6ea99 Mon Sep 17 00:00:00 2001 From: David DeSandro Date: Mon, 7 Feb 2011 22:08:45 -0500 Subject: [PATCH] docs : use `parseFloat` for weight sorting data. Resolves #5 --- _layouts/elements.html | 2 +- _posts/demos/2010-12-30-sorting.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/_layouts/elements.html b/_layouts/elements.html index f49d670..0e7d3fe 100644 --- a/_layouts/elements.html +++ b/_layouts/elements.html @@ -97,7 +97,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(); diff --git a/_posts/demos/2010-12-30-sorting.html b/_posts/demos/2010-12-30-sorting.html index 16926bc..3e14a3e 100644 --- a/_posts/demos/2010-12-30-sorting.html +++ b/_posts/demos/2010-12-30-sorting.html @@ -44,7 +44,7 @@ related: sorting 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();