Sha256: 993d829e1da63eb796d5116d8c9595e65fd06fac16a548a7e3deddf73b7db335
Contents?: true
Size: 583 Bytes
Versions: 10
Compression:
Stored size: 583 Bytes
Contents
# encoding: UTF-8 # Copyright 2012 Twitter, Inc # http://www.apache.org/licenses/LICENSE-2.0 module TwitterCldr module Formatters module Numbers class Base def interpolate(string, value, orientation = :right) value = value.to_s length = value.length start, pad = orientation == :left ? [0, :rjust] : [-length, :ljust] string = string.dup string = string.ljust(length, '#') if string.length < length string[start, length] = value string.gsub('#', '') end end end end end
Version data entries
10 entries across 10 versions & 1 rubygems