Class: Decidim::Log::ValueTypes::PercentagePresenter
- Inherits:
-
DefaultPresenter
- Object
- DefaultPresenter
- Decidim::Log::ValueTypes::PercentagePresenter
- Defined in:
- app/presenters/decidim/log/value_types/percentage_presenter.rb
Overview
This class presents the given value as a percentage. Check the ‘DefaultPresenter` for more info on how value presenters work.
Instance Method Summary collapse
-
#present ⇒ Object
Public: Presents the value as a percentage.
Methods inherited from DefaultPresenter
Constructor Details
This class inherits a constructor from Decidim::Log::ValueTypes::DefaultPresenter
Instance Method Details
#present ⇒ Object
Public: Presents the value as a percentage. For clarity, it strips the insignificant zeros.
Returns an HTML-safe String.
14 15 16 17 18 |
# File 'app/presenters/decidim/log/value_types/percentage_presenter.rb', line 14 def present return unless value h.number_to_percentage(value, strip_insignificant_zeros: true) end |