aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_view/helpers/number_helper.rb
Commit message (Collapse)AuthorAgeFilesLines
* Make number_to_human and number_with_precision work with negativesSantiago Pastorino2010-09-051-2/+2
|
* Fix code style a bitSantiago Pastorino2010-09-051-2/+1
|
* Fix number_to_human(0) exception [#5532 state:resolved]Ben Sharpe2010-09-051-1/+2
| | | | Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
* Deletes trailing whitespaces (over text files only find * -type f -exec sed ↵Santiago Pastorino2010-08-141-1/+1
| | | | 's/[ \t]*$//' -i {} \;)
* Removed deprecated APIs in text and number helpers [#5156 state:resolved]Łukasz Strzałkowski2010-07-261-44/+4
| | | | | | They're deprecated since 2008. It's time to get rid of them. Signed-off-by: José Valim <jose.valim@gmail.com>
* Action View is now titled.Rizwan Reza2010-06-211-0/+1
|
* Fix a bunch of minor spelling mistakesEvgeniy Dolzhenko2010-06-151-1/+1
|\
| * Fix a bunch of minor spelling mistakesEvgeniy Dolzhenko2010-06-111-1/+1
| |
* | Updated all number helpers with :locale option.Slobodan Kovacevic2010-06-111-1/+9
|/
* Added :locale option explanation for number_to_currencySlobodan Kovacevic2010-06-101-0/+2
|
* Added default currency values to NumberHelper and pass them to I18n.translateSantiago Pastorino2010-05-171-2/+5
| | | | | | [#4604 state:committed] Signed-off-by: José Valim <jose.valim@gmail.com>
* Fix error in number_with_precision with :significant option and zero value ↵Bernardo de Pádua2010-04-011-2/+6
| | | | | | [#4306 state:resolved] Signed-off-by: José Valim <jose.valim@gmail.com>
* adds missing requires for Object#blank? and Object#present?Xavier Noria2010-03-281-0/+1
|
* Rename unsignificant to insignificant.José Valim2010-03-231-13/+13
|
* NumberHelper methods should now return html_safe strings (when the inputs ↵Bernardo de Pádua2010-03-221-29/+86
| | | | | | are valid numbers or are html_safe). Also adds :raise => true (used internaly) to make the number helpers throw InvalidNumberError when the given number is invalid. Signed-off-by: José Valim <jose.valim@gmail.com>
* Adds number_to_human and several improvements in NumberHelper. [#4239 ↵Bernardo de Pádua2010-03-221-92/+229
| | | | | | state:resolved] Signed-off-by: José Valim <jose.valim@gmail.com>
* Remove some of the blank rescues from number helper. This makes the code ↵Xavier Shay2010-03-051-44/+42
| | | | | | easier to understand, as you're not left wondering what the rescue is actually doing. This does not change documented/tested behaviour. Signed-off-by: wycats <wycats@gmail.com>
* For performance reasons, you can no longer call html_safe! on Strings. ↵Yehuda Katz2010-01-311-1/+1
| | | | | | | | | | | | Instead, all Strings are always not html_safe?. Instead, you can get a SafeBuffer from a String by calling #html_safe, which will SafeBuffer.new(self). * Additionally, instead of doing concat("</form>".html_safe), you can do safe_concat("</form>"), which will skip both the flag set, and the flag check. * For the first pass, I converted virtually all #html_safe!s to #html_safe, and the tests pass. A further optimization would be to try to use #safe_concat as much as possible, reducing the performance impact if we know up front that a String is safe.
* NumberHelper#number_to_currency should output html_safe strings so the units ↵David Heinemeier Hansson2010-01-051-1/+1
| | | | are not escaped
* NumberHelper depends on big decimal extensionsJoshua Peek2009-10-031-0/+1
|
* Fix number_to_precision rounding error [#2071 state:resolved]wmoxam2009-08-081-1/+1
| | | | Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
* Ensure number_to_human_size does not strip zeros from the end [#1763 ↵Travis Briggs2009-05-171-1/+6
| | | | | | state:resolved] Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
* Fix tests on 1.9Jeremy Kemper2009-04-221-0/+2
|
* Merge docrailsPratik Naik2009-03-161-1/+1
|
* Fixed number_to_phone to work with 7 digit numbers [#2176 state:resolved]rpheath2009-03-091-1/+3
| | | | Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
* Improve i18n support for number_to_human_size helper:Yaroslav Markin2009-01-271-17/+28
| | | | | | | | | | | | * now using pluralization properly * storage unit translations moved to number.human.storage_units.units * introduced number.human.storage_units.format for languages that do not follow "{{number}} {{unit}}" format (Japanese) NOTE: I18n table changed, you will need to update your translations. [#1634 state:committed] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* Add i18n for number_to_human_size() helper storage units. Translation key is ↵Yaroslav Markin2008-11-231-4/+3
| | | | | | | | number.human.storage_units. [#1448 state:committed] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* Fixed i18n bulk translate issues in NumberHelperClemens Kofler2008-08-041-25/+31
| | | | Signed-off-by: Joshua Peek <josh@joshpeek.com>
* Updated NumberHelper: Full i18n support (except number_to_phone), ↵Clemens Kofler2008-07-291-62/+124
| | | | | | consolidated API (almost all methods now support :precision, :delimiter and :separator). Added deprecation notices for old API. Added tests for new options [#716 state:resolved] Signed-off-by: Joshua Peek <josh@joshpeek.com>
* Refactored NumberHelper API to accept arguments as an options hash [#666 ↵Clemens Kofler2008-07-211-32/+66
| | | | | | state:resolved] Signed-off-by: Joshua Peek <josh@joshpeek.com>
* align with changes in i18nSven Fuchs2008-07-061-1/+1
|
* remove core extensions in favor of I18n#translate and I18n#localizeSven Fuchs2008-07-021-1/+1
|
* remove call to self.locale from helpersSven Fuchs2008-06-231-6/+3
|
* rather cosmetic improvements of test coverageSven Fuchs2008-06-231-1/+1
|
* check self.locale instead of request.locale in helpersSven Fuchs2008-06-221-1/+1
|
* integrating I18n into RailsSven Fuchs2008-06-191-6/+12
|
* Fixed NumberHelper#number_with_precision to properly round in a way that ↵David Heinemeier Hansson2008-03-241-2/+2
| | | | | | works equally on Mac, Windows, Linux (closes #11409, #8275, #10090, #8027) [zhangyuanyi] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9086 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Added :format option to NumberHelper#number_to_currency to enable better ↵David Heinemeier Hansson2008-03-171-1/+8
| | | | | | localization support #11149 [lylo] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9052 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fix number_to_human_size incorrectly removing trailing zeros. Closes #10099 ↵Jeremy Kemper2008-02-021-1/+1
| | | | | | [libc, developingchris] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8774 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Enhance documentation coverage for fragment caching. Closes #7315 [bscofield]Marcel Molina2007-12-051-1/+1
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8307 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fix typos (closes #10378)David Heinemeier Hansson2007-12-051-1/+1
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8301 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Ruby 1.9 compat, consistent load pathsJeremy Kemper2007-10-021-5/+5
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7719 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fix number_to_human_size when using different precisions. Closes #7536. ↵Michael Koziarski2007-08-051-2/+2
| | | | | | [RichardStrand, mpalmer] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7275 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Massive documentation update for all helpers (closes #8223, #8177, #8175, ↵David Heinemeier Hansson2007-06-231-42/+69
| | | | | | #8108, #7977, #7972, #7971, #7969) [jeremymcanally] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7106 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Deprecation: remove deprecated human_size helper alias. Use ↵Jeremy Kemper2007-03-131-12/+9
| | | | | | number_to_human_size instead. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6407 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fixed NumberHelper#number_with_delimiter to use "." always for splitting the ↵David Heinemeier Hansson2007-01-261-5/+5
| | | | | | original number, not the delimiter parameter (closes #7389) [ceefour] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6045 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Use new deprecate syntax so that alternatives are given with the warningJamis Buck2006-10-241-1/+1
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5358 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Upgraded NumberHelper with number_to_phone support international formats to ↵David Heinemeier Hansson2006-10-221-62/+102
| | | | | | comply with ITU E.123 by supporting area codes with less than 3 digits, added precision argument to number_to_human_size (defaults to 1) (closes #6421) [BobSilva] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5336 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fixed that NumberHelper#number_to_delimiter should respect precision of ↵David Heinemeier Hansson2006-10-091-3/+9
| | | | | | higher than two digits (closes #6231) [phallstrom] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5249 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Added special case for "1 Byte" in NumberHelper#number_to_human_size (closes ↵David Heinemeier Hansson2006-07-051-1/+1
| | | | | | #5593) [murpyh@rubychan.de] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4537 5ecf4fe2-1ee6-0310-87b1-e25e094e27de