Module: AgilideeCommons::TextHelper

Defined in:
app/helpers/agilidee_commons/text_helper.rb

Instance Method Summary collapse

Instance Method Details

#euros(n) ⇒ Object



3
4
5
# File 'app/helpers/agilidee_commons/text_helper.rb', line 3

def euros(n)
  number_to_currency(n)
end

#percentage(n) ⇒ Object



7
8
9
# File 'app/helpers/agilidee_commons/text_helper.rb', line 7

def percentage(n)
  number_to_percentage(n, precision: 2, format: "%n %")
end

#text2html(str) ⇒ Object



11
12
13
# File 'app/helpers/agilidee_commons/text_helper.rb', line 11

def text2html(str)
  h(str).gsub("\r", "").gsub("\n", "<br />").html_safe
end