Browse files

Customize default BigDecimal formatting. [dave@pragprog.com]

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4608 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
1 parent 1ec9f8d commit d68fd78bad38dbafe35534f7218c705fa65c2dd1 Marcel Molina committed Jul 13, 2006
View
2 activesupport/CHANGELOG
@@ -1,5 +1,7 @@
*SVN*
+* Customize default BigDecimal formatting. References #5672 [dave@pragprog.com]
+
* Correctly convert <foo nil="true"> to nil when using Hash.create_from_xml. [Rick]
* Optional identity for Enumerable#sum defaults to zero. #5657 [gensym@mac.com]
View
3 activesupport/lib/active_support/core_ext/bigdecimal.rb
@@ -0,0 +1,3 @@
+require 'bigdecimal'
+
+require File.dirname(__FILE__) + '/bigdecimal/formatting.rb'
View
7 activesupport/lib/active_support/core_ext/bigdecimal/formatting.rb
@@ -0,0 +1,7 @@
+class BigDecimal #:nodoc:
+
+ alias :_original_to_s :to_s
+ def to_s(format="F")
+ _original_to_s(format)
+ end
+end

0 comments on commit d68fd78

Please sign in to comment.