Changeset 21 for trunk/lib/globalize/models/currency.rb
- Timestamp:
- 10/19/06 09:00:01 (4 years ago)
- Files:
-
- trunk/lib/globalize/models/currency.rb (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/lib/globalize/models/currency.rb
r1 r21 150 150 raise ArgumentError, "Not an amount (#{num})" if num.delete("^0-9").empty? 151 151 _dollars, _cents = num.delete("^0-9.").split('.', 2) 152 _cents = 0 if !_cents152 _cents = _cents ? _cents[0,2] : 0 153 153 Currency.new(_dollars.to_i * 100 + _cents.to_i) 154 154 when num.is_a?(Numeric)
