aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXavier Noria <fxn@hashref.com>2010-11-03 06:20:26 +0100
committerXavier Noria <fxn@hashref.com>2010-11-03 06:20:26 +0100
commit208fb2920d6c6c6be97a7086cea24f4c8220010c (patch)
tree228a6aff1253f4d364a2c8319c5803d70a7cce2a
parentc4d977fbbc31b0a6c7557846f9fe01e688a6f845 (diff)
downloadrails-208fb2920d6c6c6be97a7086cea24f4c8220010c.tar.gz
rails-208fb2920d6c6c6be97a7086cea24f4c8220010c.tar.bz2
rails-208fb2920d6c6c6be97a7086cea24f4c8220010c.zip
made a pass to the docs of :negative_format
-rw-r--r--actionpack/lib/action_view/helpers/number_helper.rb12
1 files changed, 7 insertions, 5 deletions
diff --git a/actionpack/lib/action_view/helpers/number_helper.rb b/actionpack/lib/action_view/helpers/number_helper.rb
index 42e2100099..a9400c347f 100644
--- a/actionpack/lib/action_view/helpers/number_helper.rb
+++ b/actionpack/lib/action_view/helpers/number_helper.rb
@@ -86,11 +86,13 @@ module ActionView
# * <tt>:unit</tt> - Sets the denomination of the currency (defaults to "$").
# * <tt>:separator</tt> - Sets the separator between the units (defaults to ".").
# * <tt>:delimiter</tt> - Sets the thousands delimiter (defaults to ",").
- # * <tt>:format</tt> - Sets the format of the output string (defaults to "%u%n").
- # * <tt>:negative_format</tt> - Sets the format of the output string (defaults to "-" + :format). The field types are:
- #
- # %u The currency unit
- # %n The number
+ # * <tt>:format</tt> - Sets the format for non-negative numbers (defaults to "%u%n").
+ # Fields are <tt>%u</tt> for the currency, and <tt>%n</tt>
+ # for the number.
+ # * <tt>:negative_format</tt> - Sets the format for negative numbers (defaults to prepending
+ # an hyphen to the formatted number given by <tt>:format</tt>).
+ # Accepts the same fields than <tt>:format</tt>, except
+ # <tt>%n</tt> is here the absolute value of the number.
#
# ==== Examples
# number_to_currency(1234567890.50) # => $1,234,567,890.50