Class: Picklive::Currency::GBP
- Inherits:
-
Base
- Object
- Base
- Picklive::Currency::GBP
show all
- Includes:
- ActionView::Helpers::NumberHelper
- Defined in:
- lib/picklive/currency.rb
Instance Attribute Summary
Attributes inherited from Base
#integer_amount
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from Base
#*, #+, #-, #-@, #/, #<=>, #==, [], #abs, #amount, cash?, #eql?, fake?, #for_sentence, #initialize, #inspect, #num_from, #same_type!, #to_f, #to_i, virtual?
Class Method Details
.code ⇒ Object
97
|
# File 'lib/picklive/currency.rb', line 97
def self.code ; 'GBP' ; end
|
.html_symbol ⇒ Object
100
|
# File 'lib/picklive/currency.rb', line 100
def self.html_symbol ; '£' ; end
|
.precision ⇒ Object
96
|
# File 'lib/picklive/currency.rb', line 96
def self.precision ; 100 ; end
|
.real? ⇒ Boolean
98
|
# File 'lib/picklive/currency.rb', line 98
def self.real? ; true ; end
|
.symbol ⇒ Object
99
|
# File 'lib/picklive/currency.rb', line 99
def self.symbol ; '£' ; end
|
Instance Method Details
#to_s(options = {}) ⇒ Object
104
105
106
107
108
109
110
111
112
113
114
|
# File 'lib/picklive/currency.rb', line 104
def to_s options = {}
s = number_to_currency(amount, :unit => '£')
if options[:short]
if amount < 1.0
s = "#{integer_amount}p"
else
s = s.gsub(/\.0+$/, '')
end
end
s
end
|