aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/number_helper.rb
Commit message (Collapse)AuthorAgeFilesLines
* Minor Refactoring to `NumberHelper#number_to_human`Vipul A M2013-10-141-4/+2
| | | | | * Use destructive `map` and `sort_by` to save extra object creation. * Create `INVERTED_DECIMAL_UNITS.invert` constant instead of repeatedly doing `DECIMAL_UNITS.invert`
* Fix typo in number_to_human docs: you -> yourMac Martine2013-09-241-1/+1
|
* Fix examples of number_to_percentageRafael Mendonça França2013-07-181-8/+8
| | | | [ci skip]
* refactor number helperVipul A M2013-04-251-2/+3
|
* Address edge case for number_to_human with units option.hoffm2013-02-221-1/+1
| | | | | | ActiveSupport::NumberHelper#number_to_human now returns the number unaltered when the units hash does not contain the needed key, e.g. when the number provided is less than the largest key provided.
* update some AS code examples to 1.9 hash syntax [ci skip]Francesco Rodriguez2012-09-121-10/+10
|
* Ensure I18n format values always have precedence over defaultsCarlos Antonio da Silva2012-08-111-42/+40
| | | | | | | | | | | | | | | | | | | Always merge I18n format values, namespaced or not, over the default ones, to ensure I18n format defaults will have precedence over our namespaced values. Precedence should happen like this: default :format default :namespace :format i18n :format i18n :namespace :format Because we cannot allow our namespaced default to override a I18n :format config - ie precision in I18n :format should always have higher precedence than our default precision for a particular :namespace. Also simplify default format options logic.
* Fallback to :en locale instead of handling a constant with defaultsCarlos Antonio da Silva2012-08-111-19/+130
| | | | | | | | Action Pack already comes with a default locale fine for :en, that is always loaded. We can just fallback to this locale for defaults, if values for the current locale cannot be found. Closes #4420, #2802, #2890.
* Move constants to the top, remove freezeCarlos Antonio da Silva2012-06-241-5/+5
|
* Remove some not used variables and improve code a bitCarlos Antonio da Silva2012-06-241-12/+7
|
* add :nodoc: to AS::NumberHelper private methods [ci skip]Francesco Rodriguez2012-06-051-99/+100
|
* Review requires from number helperCarlos Antonio da Silva2012-05-281-5/+4
| | | | | | | | Some of these requires are now only necessary in ActiveSupport::NumberHelper. Add hash/keys require due to symbolize_keys usage in number helpers. Also remove some whitespaces. Closes #6414
* Fix handling of negative zero in number_to_currencyJared Beck2012-05-281-1/+1
|
* Moving NumberHelpers from ActionView to ActiveSupportAndrew Mutz2012-05-271-0/+532