Skip to content

Commit

Permalink
optimized two_digits Numeric helper thanks to GMFlash
Browse files Browse the repository at this point in the history
  • Loading branch information
mattetti committed Oct 6, 2008
1 parent e76d7eb commit 462369c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion merb-helpers/lib/merb-helpers/core_ext/numeric.rb
Expand Up @@ -244,7 +244,7 @@ def self.to_currency(number, format_name = nil, options = {})
#---
# @private
def self.two_digits(number)
number.to_s.map{|t| t.length == 1 ? '0'+t : t }.to_s
(0..9).include?(number) ? "0#{number}" : number.to_s
end

# Converts a +numeric+ value representing minutes into a string representing an hour value
Expand Down

0 comments on commit 462369c

Please sign in to comment.