# File ../lib/currencystring.rb, line 44
        def to_currency_s(lang=nil)
                lang = ENV["LANG"] if lang.nil? && !ENV["LANG"].nil?
                return "?" if !@@currencystr_config.keys.include?(lang)
                valors                = sprintf("%.2f",self)
                cents                 = valors.scan(/\.\d{1,2}/).join
                cents                 = cents[1..-1].to_s.rjust(3,"0")
                integer               = valors.split(".#{cents}").join
                integer               = integer.rjust(integer.size%3==0 ? integer.size : integer.size+3-(integer.size%3),"0")
                valora                = integer.scan(/\d{3}/)
                index                 = valora.size
                str                   = []
                escalas               = @@currencystr_config[lang]["scales"]
                separators    = @@currencystr_config[lang]["separators"]
                currency              = integer.to_i > 1 ? escalas[1][1] : escalas[0][1]
                currency.strip!

                if integer.to_i > 0
                        valora.each do |valort|
                                str << build_value(index,valort,lang)
                                index -= 1
                        end
                        str = str.select {|item| item.strip.length>0}
                        str = join(str,lang,separators) if str.size > 1
                        str << currency
                end

                if cents.to_i > 0
                        str << separators[0].strip if integer.to_i > 0
                        str << build_value(0,cents,lang)
                        str << (cents.to_i == 1 ? escalas[0][0] : escalas[1][0]).strip
                end
                str.join(" ").strip.gsub(/ ,/,",")
        end