Sha256: 2e3e2b2af7687762a2aac11f68dd23f8a58e3a264455df16d088976724b6634d
Contents?: true
Size: 650 Bytes
Versions: 13
Compression:
Stored size: 650 Bytes
Contents
# encoding: UTF-8 # Copyright 2012 Twitter, Inc # http://www.apache.org/licenses/LICENSE-2.0 module TwitterCldr module Formatters class PercentFormatter < NumberFormatter DEFAULT_PERCENT_SIGN = "%" def initialize(options = {}) @tokenizer = TwitterCldr::Tokenizers::NumberTokenizer.new(:locale => self.extract_locale(options), :type => :percent) super end def format(number, options = {}) super(number, options).gsub('ยค', @tokenizer.symbols[:percent_sign] || DEFAULT_PERCENT_SIGN) end def default_format_options_for(number) { :precision => 0 } end end end end
Version data entries
13 entries across 13 versions & 1 rubygems