Skip to content
This repository
Browse code

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...
commit d68fd78bad38dbafe35534f7218c705fa65c2dd1 1 parent 1ec9f8d
Marcel Molina authored
2  activesupport/CHANGELOG
... ... @@ -1,5 +1,7 @@
1 1 *SVN*
2 2
  3 +* Customize default BigDecimal formatting. References #5672 [dave@pragprog.com]
  4 +
3 5 * Correctly convert <foo nil="true"> to nil when using Hash.create_from_xml. [Rick]
4 6
5 7 * Optional identity for Enumerable#sum defaults to zero. #5657 [gensym@mac.com]
3  activesupport/lib/active_support/core_ext/bigdecimal.rb
... ... @@ -0,0 +1,3 @@
  1 +require 'bigdecimal'
  2 +
  3 +require File.dirname(__FILE__) + '/bigdecimal/formatting.rb'
7 activesupport/lib/active_support/core_ext/bigdecimal/formatting.rb
... ... @@ -0,0 +1,7 @@
  1 +class BigDecimal #:nodoc:
  2 +
  3 + alias :_original_to_s :to_s
  4 + def to_s(format="F")
  5 + _original_to_s(format)
  6 + end
  7 +end

0 comments on commit d68fd78

Please sign in to comment.
Something went wrong with that request. Please try again.