Class: Cldr::Format::Decimal::Base
- Inherits:
-
Object
- Object
- Cldr::Format::Decimal::Base
- Defined in:
- lib/cldr/format/decimal/base.rb
Instance Method Summary collapse
Instance Method Details
#interpolate(string, value, orientation = :right) ⇒ Object
5 6 7 8 9 10 11 12 13 14 |
# File 'lib/cldr/format/decimal/base.rb', line 5 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 |