Sha256: 20c2b44056daaf1ac4bbe39454da8431d2da33e3fc0e568ad541c1cb00294dfc
Contents?: true
Size: 606 Bytes
Versions: 26
Compression:
Stored size: 606 Bytes
Contents
# frozen_string_literal: true module Decidim module Log module ValueTypes # This class presents the given value as a percentage. Check # the `DefaultPresenter` for more info on how value # presenters work. class PercentagePresenter < DefaultPresenter # Public: Presents the value as a percentage. For clarity, # it strips the insignificant zeros. # # Returns an HTML-safe String. def present return unless value h.number_to_percentage(value, strip_insignificant_zeros: true) end end end end end
Version data entries
26 entries across 26 versions & 1 rubygems