From 5194d1a42ccfceb2747a03c06e0b7ac7912f44b9 Mon Sep 17 00:00:00 2001 From: David Zhang Date: Wed, 13 Jul 2016 10:52:18 +0800 Subject: [PATCH] Add to_integer filter --- lib/jekyll/filters.rb | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lib/jekyll/filters.rb b/lib/jekyll/filters.rb index 231eb7b6..71e0dabd 100644 --- a/lib/jekyll/filters.rb +++ b/lib/jekyll/filters.rb @@ -260,6 +260,15 @@ module Jekyll end end + # Convert the input into integer + # + # input - the object string + # + # Returns the integer value + def to_integer(input) + input.to_i + end + # Sort an array of objects # # input - the object array