Sha256: 94a5fe3723defa886a49c12a2ce212ea9f84bdefe3b5983d56c63907bd67de5e
Contents?: true
Size: 359 Bytes
Versions: 12
Compression:
Stored size: 359 Bytes
Contents
# frozen_string_literal: true module Spout module Helpers # Provides method to format large numbers with delimiters. module NumberHelper def number_with_delimiter(number, delimiter = ",") number.to_s.reverse.scan(/(?:\d*\.)?\d{1,3}-?/).join(delimiter).reverse end module_function :number_with_delimiter end end end
Version data entries
12 entries across 12 versions & 1 rubygems