lib/knj/locales.rb in knjrbfw-0.0.23 vs lib/knj/locales.rb in knjrbfw-0.0.24

- old
+ new

@@ -38,12 +38,11 @@ end #Returns a float from the formatted string according to the current locale. def self.number_in(num_str) lc = Knj::Locales.localeconv - num_str = num_str.to_s.gsub(lc["thousands_sep"], "").gsub(lc["decimal_point"], ".").to_f - return num_str + return num_str.to_s.gsub(lc["thousands_sep"], "").gsub(lc["decimal_point"], ".").to_f end #Returns the given number as a formatted string according to the current locale. def self.number_out(num_str, dec = 2) lc = Knj::Locales.localeconv @@ -58,11 +57,9 @@ #ignore. end if Thread.current[:locale] return Thread.current[:locale] - elsif $locale - return $locale elsif ENV["LANGUAGE"] return ENV["LANGUAGE"] end raise "Could not figure out locale." \ No newline at end of file