similar to: Rails 3 and saving decimal values from a form

Displaying 20 results from an estimated 20000 matches similar to: "Rails 3 and saving decimal values from a form"

2010 Apr 03
2
Specifying a decimal field precision/scale with scaffold requires 2 steps?
Hi, It appears to me that the command: ruby script/generate scaffold whatever money_field:decimal(10,2) will not generate a valid migration. Therefore it appears to me only two ways to achieve the desired result is: 1.1 Omit the the precision/scale on the scaffold command 1.2 Edit the migration file by following the "do |t| ... end" with the command: change_column :whatever
2010 Sep 04
2
Decimal numbers pain
Hi, What do you guys use to definitely handle decimal numbers? This is getting me crazy! I use BigDecimal, but it craps out of the input number is something like "14,53", Rails transforms it as 14.0 Any solution? -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to
2010 Mar 10
2
Decimal fields generated in Rails 2.3.5 act like strings, sort of
Hi All, I just created a new CRUD "expense" (using Rails 2.3.5 scaffold) which included "amount:decimal". When I: 1. populated the amount field of a new expense with 5 characters: 12.50 and 2. saved the new record I got a display of the new record that showed Amount to be merely "12". I clicked Update and put my cursor over the data field for Amount and got a
2011 Apr 20
6
rake db:create fails
Hello folks, I´m here trying to find the way to solve my problem. When i try to run rake db:create or rake db:create:all the process stops and the databases are not created. I change the directives, putting --trace before the rake db:create and the steps are C:\appws\cookbook>rake db:create --trace (in C:/appws/cookbook) ** Invoke db:create (first_time) ** Invoke db:load_config (first_time)
2020 Jan 28
2
[RFC] Print FP constant assembly in hexadecimal form instead of decimal
Hi: When debugging some floating point assembly, we found it is inconvenient to read the decimal constants in assembly. In hex form many FP numbers are immediately recognizable, their exponents are more obvious etc. We normally use hex form in debugger or LLVM IR, not sure what is the reason that we want to use decimal in assembly? The form change won't change precision or affecting
2012 Mar 02
2
Change DB data type and limited decimals
Rails3.1.3 I have db type, startp:integer I need to change it to float. More specifically, 1.2, 45.1, 143.8 ... I have two questions: 1. Is removing and adding the field through migration the only way? in other words, is there a single command to change the type? 2. Is there anyway to limit the decimal place to only one? 56.3, 34.2... are acceptable, but 23.112, 77.34, ... are
2010 Apr 23
2
Blog ruby on rails/Django Fastes made
Hi I''ve got a little quetion. For school I''ve to make a blog either using ruby on rails or Django. I''ve to do this at home, install the languages, etc. I''ve to make screenshots while running the language and blog. tell why I chose that language and the files i made for the blog. What would be the fastes way to do this?? Thanks a lot already -- Posted via
2024 Jul 14
2
Reinterpret data without saving it to a file 1st? Check for integer stopping at 1st decimal?
A small number of columns in the data I need to work with are strings, the rest numbers. I'm using read_excel() from the readxl package to get the data ; right after it, the string columns are of type chr and the rest num. I'm tasked with finding out which columns are integers. From an advice, I tried saving the spreadsheet content into a CSV then loading that, which works like a charm ;
2007 Sep 11
1
storing text and decimal values in a matrix form
Hi, I would like to store some text and decimal values in the following form: name dec.val dec.val ... dec.val name dec.val dec.val ... dec.val ... name dec. val dec.val ... dec.val To do so, I created a matrix of the necessary size (x row per y cols) with the command matrixname <- matrix(0,x,y) and proceeded to fill in the matrix with information drawn from a data frame. The
2010 Dec 23
36
Weird issue with converting floats to integer
Any idea why this calculates the integer the way it does? irb> ("291.15".to_f * 100.0).to_i => 29114 Thanks, Tom -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to
2006 Feb 23
3
Decimal comma instead of decimal point (i18n issue)
Hello, What is the easiest way which enables usage of decimal comma "," instead of decimal point (".") . I would like to force all RoR views to display float numbers with comma instead of decimal point and also to allow insertion of float numbers with comma in forms. Thanks in advance, Karel -- Posted via http://www.ruby-forum.com/.
2012 Sep 12
8
Round off method in 1.8.7
Hi all i am trying to use round method if have a value 2.08 i want it as 2.1 and it worked in 1.9.2 but not in 1.8.7 is there any other way of doing it. USING 1.9.2 1.9.2p320 :001 > 2.08.round(1) => 2.1 1.9.2p320 :002 > 2.04.round(1) => 2.0 USING 1.8.7 irb(main):001:0> 2.08.round => 2 irb(main):002:0> 2.08.round(1) ArgumentError: wrong number of arguments (1 for
2006 Apr 11
2
Schema.rb and MySQL decimal
Hi, I have a mysql schema with some decimal(20,20) fields. Now, I made a rake db_schema_dump for deployment of my applications on other machines. Rails created a schema.rb with the decimal fields as float. After a rake db_schema_import the fields are just float not decimal. How can I force rails to create decimal(20,20) columns instead of float? Thx. Marc -- Posted via
2006 Jul 21
1
saving money as decimals now ok?
Now that Rails core converts a database''s decimal type into a Ruby BigDecimal type, is it ok to now store money information as a decimal in the database (instead of an integer)? Joe
2006 May 04
3
Decimal
Can someone please tell me the best approach to adding support for editing MySQL decimal types in rails? I have a field in the DB that represents currency, and the view will not let save anything past the decimal place so, 10.99 becomes 10.00 automatically. Any help is appreciated. -- Posted via http://www.ruby-forum.com/.
2006 Jun 30
4
always show 2 decimal places
Hi, I have a float that often looks like somthing like 2003.2 in my controller (1 decimal place) Is there a way to always show it to 2 decimal places eg 2003.20 ? Thanks Scott -- Posted via http://www.ruby-forum.com/.
2009 Mar 18
4
[LLVMdev] decimal to floating point conversion
Hi all: I need an instruction that can convert decimal values into floating point numbers. i.e. say I have a decimal number 1110794174 (== 42355FBE in hex ) and (== 45.3435 as a float) essentially the mantissa and exponent representation needs to be used. Is there any way of doing this in llvm? Thanks and Regards -- -- Aparna Kotha Graduate Student Electrical and Computer Engineering
2012 Jan 12
2
Rails think db column is integer when it is a float
Hi, I came across the strangest issue I have no idea how it happened. In my development environment, I created a new migration and model that uses a couple of decimal column types (among others). Everything works great with sqlite and the development environment, business as usual. However, I deployed to production and for some completely unknown reason, this particular table (only this one)
2011 Jan 14
2
read in data, maintain decimal places
Good day, All, Is there any way to maintain the number of decimal places in the type of situation below? I would like to maintain the number of decimal places in 0.667, despite the fact that its column-mates have a fourth decimal place. Thank you for your time. Jim dat.txt contents: MARKER ALLELES FREQ1 RSQR EFFECT2 STDERR CHISQ PVALUE rs6599753 C,T
2007 Sep 23
2
Plotting numbers at a specified decimal length on a plot()
Hi there, I want to figure out how to plot means, with 2 decimal places, of any Y variable on a scatterplot according to any X variable (which obviously should have limited scope). I already figured out how to plot the means, but without limiting their precision to 2 decimal places. This is the code I used once I had the scatterplot drawn: text(c(1990, 1992, 1994, 1996, 1998, 1999, 2000,