similar to: Truncating Float column in MySQL

Displaying 20 results from an estimated 60000 matches similar to: "Truncating Float column in MySQL"

2007 May 03
2
Truncating trailing digits
Hello, I am relatively new to R and have a rudimentary question, I think. How does one truncate the number of digits displayed after the decimal when viewing the results of analyses? My apologies if this question has been answered previously, I was not able to find references very easily. Thank you in advance, Matt [[alternative HTML version deleted]]
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)
2006 Jun 20
3
Rails and decimal types mapped to float
Hi, I''m a brazilian developer, work in a hospital and we have a legacy database that we want to access via rails. Rails maps decimal types to float, and to circumvent this problem the suggestion one can find on the list is to represent decimal values as cents. That''s not applicable when you have to access a legacy database. I found two tickets 4274 and 4605 on rails trac,
2004 Apr 21
1
RODBC and SQlServer Float type
Hi, I'm trying to get data from a MS SqlServer database into R, using the RODBC package. The problem I've found is that numeric data from my sql queries is returned with only two decimal digits. After searching the docs, I think the problem comes from my sql numeric data having "float" type instead of "double", as I found the following: "Where possible
2012 Nov 29
1
Read in alphanumeric column without decimals
All - How can I read in a column of alphanumeric values without including ".0" on the numeric values? Original column: TeamLeaderID 258 342 316 U8 331 279 D1 116 235 296 ... [truncated] leaders = read.xlsx2('FILE', sheetIndex = 1, header = T) Column after it's been read in: leaders$TeamLeaderID 258.0 342.0 316.0 U8 331.0 279.0 D1 116.0 235.0 296.0 ... [truncated] If I
2009 Feb 11
1
[LLVMdev] Suggested change to docs re: double/float constant syntax.
It appears to me based on my experiments with llvm-as that literal floating-point constants may be specified in the 64-bit IEEE hexadecimal format, but not in the 32-bit format. For instance, this file: target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32- i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64- f80:128:128" target triple =
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
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
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
2010 Jun 02
1
[LLVMdev] Generating Floating point constants
Le 2 juin 2010 à 19:48, Dale Johannesen a écrit : > > On Jun 2, 2010, at 3:28 AMPDT, Stéphane Letz wrote: > >> >> Le 2 juin 2010 à 12:21, Eli Friedman a écrit : >> >>> On Wed, Jun 2, 2010 at 2:59 AM, Stéphane Letz <letz at free.fr> wrote: >>>> Hi, >>>> >>>> We need to generate "Floating point constants"
2010 Jun 03
1
[LLVMdev] Generating Floating point constants
> ------------------------------ > > Message: 4 > Date: Wed, 2 Jun 2010 11:07:39 -0700 > From: Dale Johannesen <dalej at apple.com> > Subject: Re: [LLVMdev] Generating Floating point constants > To: St?phane Letz <letz at free.fr> > Cc: llvmdev at cs.uiuc.edu > Message-ID: <AEC895CC-E887-4329-8743-FA606BD401F6 at apple.com> > Content-Type:
2010 Jun 02
0
[LLVMdev] Generating Floating point constants
On Jun 2, 2010, at 3:28 AMPDT, Stéphane Letz wrote: > > Le 2 juin 2010 à 12:21, Eli Friedman a écrit : > >> On Wed, Jun 2, 2010 at 2:59 AM, Stéphane Letz <letz at free.fr> wrote: >>> Hi, >>> >>> We need to generate "Floating point constants" in our code. In http://llvm.org/docs/LangRef.html it is explained that FP has to follow special
2009 Dec 29
3
as.numeric is truncating!
I am trying to convert a string to a double using "as.numeric" However, R is truncating the results! Options(digits) is set to 7. Can anyone shed some light on this? Thanks! > b[1] [1] "116.28125" > summary(b[1]) Length Class Mode 1 character character > c <- as.numeric(b[1]) > c [1] 116.2812 -- View this message in context:
2009 Feb 04
1
How to declare an array with columns storing different datatypes/precision
Dear R- Experts, Seek your help. I want to creata data as follows. Ref_array with 4 columns. 1st column should store data of precision: 8.4 (i.e. 8 digits before decimal point and 4 digits after decimal points) 2nd column: should store data of type date "yyyy-mm-dd hh:mm:ss" 3rd column: only integer value. No decimal points 4th column: percentage values Please help. Thank you in
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
2006 Aug 29
1
float/decimal with dot or comma
Hi, I''m facing a really strange behaviour with rails 1.1.6. A model has a field declared as :float in schema.rb, as numeric in postgres 8.1. On save/update, rails makes the decimal point become a comma on the prod server only, hence making a sql error. This error was not there three weeks ago, i.e. when my prod server was in 1.1.4. Maybe something else changed, I cannot be sure
2004 Feb 06
1
0.1 + 0.2 != 0.3 revisited
Prompted by Peter Dalgard's recent elegant "intbin" function, I have been playing with the extension to converting reals to binary representation. The decimal part can be done like this: decbase <- function(x, n=52, base=2) { if(n) { x <- x*base paste(trunc(x), decbase(x%%1, n-1, base), sep="") } } n=52 default because that's the number of bits in
2009 Apr 16
3
"reverse truncate" to extract only decimal values
hello there, Is there a way of truncating in the opposite direction so as to retain only the values to the right of the decimal?? i.e. rather than: > trunc(39.5) [1] 39 i would get something like: > revtrunc(39.5) [1] 0.5 I've been searching to no avail but I imagine there is a very simple solution! Tyler -- View this message in context:
2006 Apr 01
7
BigDecimal column type?
I was hoping 1.1 would provide a way to map SQL "decimal" column types to BigDecimal values, since BigDecimal is part of the Ruby standard api as of 1.8. But I don''t see any support for that in the migration documentation, and when I try to let Active Record do the mapping for me, it seems to coerce the column into a Float (as the AwdwR book says). Is it really there in
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