Class: HDecoratorFunctions

Inherits:
Object
  • Object
show all
Defined in:
lib/hmisc/hdecoratorfunctions.rb

Class Method Summary collapse

Class Method Details

.numberToMoney(value = "@arg@") ⇒ Object



5
6
7
8
9
10
11
12
# File 'lib/hmisc/hdecoratorfunctions.rb', line 5

def self.numberToMoney(value = "@arg@")

  return value  
  currency = HConfiguration.instance().value("currency").to_sym
  decimals = HConfiguration.instance().value("decimals") 
  return "ActionController::Base.helpers.number_to_currency(#{value}, precision: #{decimals}, locale: :#{currency}).to_s" if(value == "@arg@")
  return ActionController::Base.helpers.number_to_currency(value, precision: decimals, locale: currency).to_s
end