Browse Source

docs : `parseFloat` to sorting docs

v1
David DeSandro 14 years ago
parent
commit
65e59de936
  1. 4
      _posts/docs/2010-12-07-sorting.mdown

4
_posts/docs/2010-12-07-sorting.mdown

@ -66,7 +66,7 @@ $('#container').isotope({
{% endhighlight %} {% endhighlight %}
For numerical data, we can convert a text value into a number via `parseInt()` function. For numerical data, we can convert a text value into a number with `parseInt()` or `parseFloat()`.
{% highlight javascript %} {% highlight javascript %}
@ -76,7 +76,7 @@ getSortData : {
return parseInt( $elem.find('.name').text(), 10 ); return parseInt( $elem.find('.name').text(), 10 );
}, },
weight : function ( $elem ) { weight : function ( $elem ) {
return parseInt( $elem.find('.weight').text(), 10 ); return parseFloat( $elem.find('.weight').text() );
} }
} }

Loading…
Cancel
Save