Permalink
Browse files

Merge branch 'master' into rbtree

  • Loading branch information...
2 parents ab679d4 + 63b4d44 commit cb4bf3a62d23d0d0e5010169be14c8ec5472f500 @kouno committed Sep 5, 2012
Showing with 8 additions and 3 deletions.
  1. +2 −2 lib/activefacts/api/numeric.rb
  2. +6 −1 spec/object_type/value_type/numeric_spec.rb
@@ -32,8 +32,8 @@ def ==(o) #:nodoc:
__getobj__.==(o)
end
- def to_s #:nodoc:
- __getobj__.to_s
+ def to_s *a #:nodoc:
+ __getobj__.to_s *a
end
def to_json(*a) #:nodoc:
@@ -51,7 +51,12 @@
describe Decimal do
it "should still detect Decimal as the main class" do
- bd = Decimal.new("98765432109876543210")
+ bd = Decimal.new("98765432109876543.210")
+ bd.to_s("F").should == "98765432109876543.21"
+ bd.to_s("E").should == "0.9876543210987654321E17"
+ bd.to_s("3E").should == "0.987 654 321 098 765 432 1E17"
+ bd.to_s(3).should == "0.987 654 321 098 765 432 1E17"
+ bd.to_s("3F").should == "987 654 321 098 765 43.21"
bd.should be_a Decimal
bd.should be_a BigDecimal
end

0 comments on commit cb4bf3a

Please sign in to comment.