lib/knj/locales.rb in knjrbfw-0.0.98 vs lib/knj/locales.rb in knjrbfw-0.0.99
- old
+ new
@@ -63,10 +63,10 @@
#===Examples
# Knj::Locales.number_out(123456.68) #=> "123,456.68"
def self.number_out(num_str, dec = 2)
lc = Knj::Locales.localeconv
- require "php4r"
+ require "php4r" if !Kernel.const_defined?(:Php4r)
return Php4r.number_format(num_str, dec, lc["decimal_point"], lc["thousands_sep"])
end
#Returns the current locale for the current environment (_session[:locale] or Thread.current[:locale]).
#===Examples
\ No newline at end of file