similar to: Rails think db column is integer when it is a float

Displaying 20 results from an estimated 9000 matches similar to: "Rails think db column is integer when it is a float"

2006 Jan 17
9
Formatting a float with a set number of decimals
Another newbie question: How do i convert a float to a string, rounded to a certain number of decimals? Thanks -- Posted via http://www.ruby-forum.com/.
2008 Nov 07
15
any tricks re using " eql(5.5)", but where 5.5 is a decimal not float?
-- Sent from my mobile device
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
2006 Apr 06
2
making an integer from a float
Does anybody know how to turn a floating-point number (i.e. 60.345) into an integer by cutting off or rounding the decimal portion? Either method, or both, would be quite welcome. Thanks! This forum rocks! -- Posted via http://www.ruby-forum.com/.
2006 Feb 15
2
Financial app - decimal to float conversion problem
I''m having problems with using Rails for a financial application: the database stores financial fields as decimal, but ActiveRecord converts these to float - so I get the rounding errors you''d expect (http://www.mindprod.com/jgloss/floatingpoint.html). This has come up recently, and the recommended fix seems to be to be Tobi Luetke''s ''money'' gem
2007 Jun 09
11
authentication, controller specs. I think I''m missing something simple ....
Hi all, I feel like I''m missing something really easy and I''m just not seeing it. I''m using the restful_authentication plugin and have a User model. Uesr has_many :things and Thing belongs_to :user. That''s it. I did a "script/generate rspec_scaffold thing" to generate all the necessary bits. The "rake db:migrate" to create the db. At
2007 Nov 27
3
Disappearing decimals... please help!
Maybe it''s all in my head, but I''m having the strangest little issue ever. My pricetags in my rails app are always whole numbers. Rails seems to completely ignore my decimal input. So as a consequence, 10.41 becomes 10.00, always. Here''s some worthwhile stuff: within my 004_create_products.rb file: :price, :decimal, :percision => 2, :default => 0 And calling
2018 Dec 06
1
Dealing with .git folder when using R CMD INSTALL
On 6 December 2018 at 15:59, Ralf Stubner wrote: | On 06.12.18 15:19, Joris Meys wrote: | > I know this R CMD build ignores these files and folders by default, but R | > CMD INSTALL doesn't apparently. | | to me this is not apparent. I just tried "R CMD INSTALL ." in a package | directory with a .git directory. This went without any problems. What do | you observe? Seconded.
2018 Dec 06
5
Dealing with .git folder when using R CMD INSTALL
Dear all, quite a few package tools depend on R CMD INSTALL today for rapid testing of a package, eg: - devtools::install() - BiocCheck::BiocCheck() I've noticed that at least BiocCheck() doesn't ignore version control folders like .git. Trying to find out why this was, lead me to R CMD INSTALL. I know this R CMD build ignores these files and folders by default, but R CMD INSTALL
2006 Feb 26
2
How to capture the last DB insertion id ??
Hi all, I''ve got a model - Images - and when I insert a new image into that db,table I would like to grab hold of the last insertion id of that row/record and then process it further and save reworked version back into the db.table again. Example: a new image gets inserted as a db.table.row with ID = 12345678 (id = primary key) The ID (12345678) is then retrieved and processed
2006 Jun 07
1
Setter that converts a float attribute to integer
Hi, I have some problems with an application where I''m using custom accessors to do currency conversions. In my model, I have a price attribute in the database that stores the value in cents, to avoid future problems with float arithmetic and round. But at the views, I would like to show the price in euros, with decimal for the cents. So I defined a new attribute called price_in_euros,
2009 Sep 09
1
Stats help with calculating between and within subject variance and confidence intervals
Hello. I'm trying to find a way in R to calculate between and within subject variances and confidence intervals for some analytical method development data. I've found a reference to a method in Burdick, R. K. & Graybill, F. A. 1992, Confidence Intervals on variance components, CRC Press. This example is for Balanced Data confidence interval calculation from Pg 62. The data are
2014 Jan 30
4
Cannot Join Samba 4.1 to an existing Windows 2008 domain as a Backup DC
Hi Everybody, I'm stumped. I'm pretty sure I've tried everything to get this to work. I'm trying to join my CentOS 6 server to my Server 2008 AD Domain. I'm using SerNet's samba4 packages: [root at files ~]# samba -V Version 4.1.4-SerNet-RedHat-7.el6 I've done the xattr and acl tests and they all come out just fine. So I don't think it has to do with ACLs
2006 Jul 27
1
Form entries with decimals generating float errors
I have "time estimated" and a "time spent" fields in my task form. In my tasks table I have the "time_estimated" and "time_spent" rows assigned as float types. I''ve also tried setting them to decimal (4,2) with no luck. When I submit the form the error reads "NoMethodError in TasksController#create" then "Undefined method
2002 Jul 12
5
rsync 2.5.5 Tru64 5.1
Hi, I am trying to compile rsync 2.5.5 on a Tru64 box. I downloaded configure.in revision 1.148, which I believe is the correct fix for the getaddrinfo problem; however I still have errors compiling rsync. Also I had to change line 22 in options.c from #include "popt.h" to #include "popt/popt.h". Any suggestions or ideas? Tan Dang
2017 Jul 27
0
Error in `[[<-.data.frame`(`*tmp*`, alt.name, value = integer(0)) with mlogit
Hello, Inline. Em 27-07-2017 20:36, peter dalgaard escreveu: > >> On 27 Jul 2017, at 18:03 , Jeff Newmiller <jdnewmil at dcn.davis.ca.us> wrote: >> >> Looks like you need to pay attention to how you read in your data. In general, you should always execute one statement at a time until you know your script is working. All the errors after the first one are unhelpful
2010 Nov 10
2
randomForest can not handle categorical predictors with more than 32 categories
I received this error Error in randomForest.default(m, y, ...) : Can not handle categorical predictors with more than 32 categories. using below code library(randomForest) library(MASS) memory.limit(size=12999) x <- read.csv("D:/train_store_title_view.csv", header=TRUE) x <- na.omit(x) set.seed(131) sales.rf <- randomForest(sales ~ ., data=x, mtry=3, importance=TRUE) My
2010 Aug 16
2
Converting degree: minute: second data to decimal degree data, should be simple
Hi All, I have location data set up as degrees: minutes: seconds (for example, 122:45:45) I need to get this data into decimal degree form (122.7625). I know that I need to use the formula Decimal degrees = Degrees + (Minutes/60) + (Seconds/3600) Does anyone know how I can get R to do this? The original data is all in one column (called 'lat') and the degrees, mins and secs are
2011 Feb 21
2
Delete Comment Lines from SQL String as a Vector
Hi, I tried to remove the text starts by "--" to the end of the line as below sql=c("-- This is a comment line", "select sysdate -- This is a comment Text" , " from dual ") >sql [1] "-- This is a comment line" [2] "select sysdate -- This is a comment Text" [3] " from dual " I try to have this > sql
2017 Jul 27
3
Error in `[[<-.data.frame`(`*tmp*`, alt.name, value = integer(0)) with mlogit
> On 27 Jul 2017, at 18:03 , Jeff Newmiller <jdnewmil at dcn.davis.ca.us> wrote: > > Looks like you need to pay attention to how you read in your data. In general, you should always execute one statement at a time until you know your script is working. All the errors after the first one are unhelpful to you or us. > > If you actually pay attention to what is in your