similar to: NumberHelper.number_to_human_size

Displaying 20 results from an estimated 4000 matches similar to: "NumberHelper.number_to_human_size"

2006 May 29
2
Convert bytes to kb or mb in words
Using File.size(myfile) I can get the size of the uploaded file in _bytes_. Does anybody know of a function to convert bytes into a more human readable format? If I had a wish list for a "file_size_in_words()" function, it would do this: 10752 bytes becomes "10.5 Kilobytes". 2213814 bytes becomes "2.1 Megabytes". 238 bytes becomes "Less Than 1 Kilobyte".
2009 Jul 24
7
number_to_currency not working since 2.1.1
Back in 2.1.1 everything was sweet: Loading development environment (Rails 2.3.3) >> include ActionView::Helpers::NumberHelper => Object >> number_to_currency(12.3) >> "$12.30" Then I upgraded to 2.3.2 and: Loading development environment (Rails 2.3.3) >> include ActionView::Helpers::NumberHelper => Object >> number_to_currency(12.3) >> 12.3
2015 Jan 22
0
[PATCH 2/2] mllib: convert common_utils_tests to oUnit
Covert common_utils_tests to use oUnit as testing framework, replacing the hand-made assert in favour of structured unit tests and better error reporting. common_utils_tests is now built only when the oUnit module has been found. --- mllib/Makefile.am | 17 ++++- mllib/common_utils_tests.ml | 155 +++++++++++++++++++++++++++----------------- 2 files changed, 108 insertions(+), 64
2008 Jan 22
4
Calling a function
Hi. I''m trying to call the function ''store_description(image)'' at line 9. However when I do, I get the error "undefined method ''store_description'' for Photo:Class". What can I do? 1: class Photo < ActiveRecord::Base 2: def store_description (image) 3: self.description = "size:
2006 Aug 14
2
ActionPack: number_to_phone error
Question about the number_to_phone function as provided by rails in actionpack: http://api.rubyonrails.org/classes/ActionView/Helpers/NumberHelper.html If I do this in my controller: num = number_to_phone(params[:phone_number]) I get this error: undefined method `number_to_phone'' for #<TicketsController:0xb7a2bfcc> Whereas if I do this in my view: <%
2015 May 11
3
[PATCH 1/2] mllib: Require OUnit2 for tests.
OUnit2 has an OUnit (v1) compatibility module. Unfortunately it is rather gravely broken: https://forge.ocamlcore.org/tracker/?func=detail&aid=1392&group_id=162&atid=730 Since there is no new release fixing this, it's easier to switch to using OUnit2 for unit tests. --- .gitignore | 2 +- README | 2 +- mllib/JSON_tests.ml | 56
2016 May 22
0
[PATCH 2/2] ocaml tools: Use a common debug function.
Add a common debug function for printing debugging messages. It only emits the debug message when the verbose (-v) flag is used on the command line. It sends the output to stderr, which is flushed immediately after the message is printed (to help with debugging unexpected crashes). There are good arguments for sending the debug to either stdout or stderr, and almost all existing debug messages
2014 Sep 08
3
Re: [RFC PATCH] resize: add support for MBR logical partitions some question
On Tue, Aug 26, 2014 at 06:16:50PM +0800, Hu Tao wrote: > Hi, > > The attached patch adds support for resizing MBR logical partitions. The > failure is still there, I can't get any helpful information from lsof. > Any suggestions? I don't see the error: Error: Error informing the kernel about modifications to partition /dev/sdb5 However I do see this error:
2015 Oct 20
1
[PATCH v3 07/13] v2v: factor out copying of output data
Factor out copying the overlays to final disk images into a separate function. Signed-off-by: Roman Kagan <rkagan@virtuozzo.com> --- v2v/v2v.ml | 227 +++++++++++++++++++++++++++++++------------------------------ 1 file changed, 114 insertions(+), 113 deletions(-) diff --git a/v2v/v2v.ml b/v2v/v2v.ml index afffde2..703038c 100644 --- a/v2v/v2v.ml +++ b/v2v/v2v.ml @@ -110,121 +110,9 @@ let
2009 Mar 20
1
Getting a Time Zone abbreviation from the full name?
There''s got to be an easier way... I am building an event manager and as part of it, the user selects the time zone of the event from a drop-down list using the time_zone_select helper. This is stored in the events table as a string. Because of legacy data which is stored in UTC, I want to keep the dates and times in the table as UTC but when I display it, I want to show the abbreviated
2012 Jan 22
2
if/else statement without curly brackets gives a problem
Hello, This example seems strange to me: > if (2 > 3) print('Yes'); else print('No') Error: unexpected 'else' in " else" > {if (2 > 3) print('Yes'); else print('No')} Error: unexpected 'else' in "{if (2 > 3) print('Yes'); else" > { + if (2 > 3) print('no') + else print('yes') + }
2007 Jun 05
4
uninitialized constant RailsHandler::Dispatcher
Hello, I am running in to an error trying to run mongrel. The server starts but then trying to access any url in my application throws this error: calling Dispatcher.dispatch uninitialized constant RailsHandler::Dispatcher ./script/../config/../vendor/rails/activesupport/lib/active_support/dependencies.rb:477:in `const_missing''
2016 Dec 04
0
syslinux, raid 1, and metadata 1.2
Hi, it seems that booting from software raid 1 is not a problem, as long you're using metadata version 0.9 or 1.0. Then, the raid metadata is at the end of the device. But people found that there are certain risks, for example that the filesystem can be mounted without using the raid layer which may leave you with two copies that are out of sync. Now metadata 1.0 and 1.2 put the metadata at
2011 Oct 26
3
Overriding number_to_human (Rails 3.0.5)
I encountered a problem today, in that the number_to_human helper has a defect where it spits out an error when passed any number bigger than 0 and less than 1. eg number_to_human(0.2) gives "nil can''t be coerced into fixnum" So, I found this patch: https://github.com/rails/rails/commit/7c8a5f5759a0c63945d133280fb78deaa86b65b9 Now to apply it, I had to create a file:
2006 Jun 18
0
Rails Core Weekly June 11 - June 18
This is another edition of Rails Core Weekly, affectionately known as RCW. A much nicer pre-web 3.0 version is available from the following url : http://www.pinupgeek.com/articles/category/rails-core-weekly-news We have an Atom/RSS feed available there as well. Rails Core Weekly summarizes the rails-core mailing list, a list dedicated to Ruby on Rails internals and its development. RCW is
2018 Apr 04
0
nouveau TRAP_M2MF still there on G98
On Wed, Apr 4, 2018 at 6:58 PM, Adam Borowski <kilobyte at angband.pl> wrote: > On Wed, Apr 04, 2018 at 03:48:39PM +0300, Māris Nartišs wrote: >> 2018-04-03 23:00 GMT+03:00, Adam Borowski <kilobyte at angband.pl>: >> > In commit da5e45e619b3f101420c38b3006a9ae4f3ad19b0 >> > >> > yet it is still reproducible for me on 4.16-rc7 and 4.16.0, which
2023 Oct 06
2
[libnbd PATCH 0/2] Improve nbdinfo display of block constraints
Based on Laszlo's approval of my idea here: https://listman.redhat.com/archives/libguestfs/2023-September/032661.html but as I would like to resync human-size.h back to nbdkit, I'm reluctant to apply patch 1 this until I get Rich's consent to relicensing (this email serves as my consent for my contribution here): https://listman.redhat.com/archives/libguestfs/2023-October/032755.html
2005 Sep 07
1
Language issue
Dear all, I am running R : Copyright 2005, The R Foundation for Statistical Computing Version 2.1.1 (2005-06-20), ISBN 3-900051-07-0 Under Mac os X, a french version! I am preparing a package and I got the following issue I am trying to read dates that are written in english and have them recognized by R using as.Date function. I realized strangely that when I type > month.abb [1]
2016 Sep 19
0
[PATCH 2/3] mllib: expose disk decrypt functionalities
Expose via Common_utils the C functions & variables (part of guestfish) that handle decryption of LUKS partitions, and the additional command line arguments to tune the way they work. This way it will be easy to provide (basic) crypto support also in OCaml-based tools. Related to: RHBZ#1362649 --- mllib/Makefile.am | 3 ++ mllib/common_utils-c.c | 75
2013 Jan 30
1
[PATCH v2] xen: print "debug=y|n" during hypervisor startup
So that we can easily figure out whether or not we are running a debug build of Xen (e.g., via `xl dmesg''). Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com> --- Changes from v1: * moved the #ifndef-ery around variable definition; * repositioned the "debug=%c" outside of the ''compiled-by'' section. diff --git a/xen/drivers/char/console.c