Displaying 20 results from an estimated 10000 matches similar to: "Increase Number of Decimals"
2008 May 29
3
Manipulating DataSets
Hello R-Users,
I am new to R and trying my best however I need help with this simple task.
I have a dataset, YM1207.
X.Symbol Date Time Exchange TickType
ReferenceNumber Price Size
12491 3:YMZ7.EC 12/03/2007 08:32:50 EC B
85985770 13379 7
12492 3:YMZ7.EC 12/03/2007 08:32:50 EC A
85985771 13380 4
12493
2008 Jan 19
1
Decimals are being converted to Bigdecimals!!!!!
Hi all,
I''m working on a financial app, and have set up some columns in my
tables as decimals with precision => 8 and scale => 2. My migration
looks like:
change_column :lineitems, :price, :decimal, :precision =>
8, :scale => 2
change_column :payments, :amount, :decimal, :precision =>
8, :scale => 2
I''ve run the migration and restarted the server. I
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
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
2009 Apr 20
8
bug when subtracting decimals?
Try this:
0.7-0.3==0.4
(We get FALSE)
0.7-0.3<0.4
(We get TRUE)
but
0.8-0.3==0.5
(TRUE)
0.8-0.3<0.5
(FALSE)
Funny, he?
There is a way around:
round(0.7-0.3,1)==0.4
(TRUE)
Obviously there is a problem with some combinations of decimal subtractions,
that - we have the feeling - shouldt be solved.
Best regards
Sven & Wolfgang
--
View this message in context:
2009 Apr 20
8
bug when subtracting decimals?
Try this:
0.7-0.3==0.4
(We get FALSE)
0.7-0.3<0.4
(We get TRUE)
but
0.8-0.3==0.5
(TRUE)
0.8-0.3<0.5
(FALSE)
Funny, he?
There is a way around:
round(0.7-0.3,1)==0.4
(TRUE)
Obviously there is a problem with some combinations of decimal subtractions,
that - we have the feeling - shouldt be solved.
Best regards
Sven & Wolfgang
--
View this message in context:
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 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/.
2005 May 22
3
comparison operator, decimals, and signif()
Hi, I recently spent quite a bit of time trouble
shooting a function that I had written only to
discover that the problem I was having was with the
comparison operator. I assumed that the following
would return TRUE:
> testMean <- 82.8 + 0.1
> testMean
[1] 82.9
> testMean == 82.9
[1] FALSE
Apparently this has to do with deciml places. Look:
> newTest <- 82.0
> newTest
[1]
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
2006 Apr 08
1
Entering numbers with decimals
Hello list,
I'm just getting started with R, and I'm trying to determine how R
treats large numbers that have decimals. Take the following two examples:
> x <- c(999999999999999.9)
> sprintf("%.5f",x)
[1] "999999999999999.87000"
> y <- c(9999999999999999.9)
> sprintf("%.5f",y)
[1] "10000000000000000.00000"
I realize that I have
2013 Feb 05
1
How to menage decimals in order to obtain accurate estimates
Hi,
I'm trying to calculate some functions loop, unfortunately my data are
decimal numbers that not allow me to get an accurate estimate. I do not want
to use neither "round "nor "signif" but I would prefer to have all the
information available, (the function loop is generic so you should adapt to
all data, not just those in particular). The approximation error is
2007 Dec 03
1
Plotting monthly timeseries with an x-axis in "time format"
I have the following timeseries "tab"
=====================================
> str(tab)
mts [1:23, 1:2] 79.5 89.1 84.9 75.7 72.8 ...
- attr(*, "dimnames")=List of 2
..$ : NULL
..$ : chr [1:2] "Ipex...I" "Omel...E"
- attr(*, "tsp")= num [1:3] 2006 2008 12
- attr(*, "class")= chr [1:2] "mts" "ts"
> tab
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 Nov 12
1
How to increase decimal places
Hello everyone,
does anybody know how to increase the decimal places that R uses to calculate something.
I think that in default R uses 6 decimal places but I need 12.
Thank you very much!
Best regards,
Maja!
--
2004 Mar 26
2
(marginal) dot diagram
I am attempting to plot something called a (marginal) dot diagram which is a regular scatterplot with an extra set of plots in the margins along both the X and Y axes. I have looked everywhere I can think for information. Can anyone give me any suggestions? Is there a single command that generates it or do I have to generate a regular scatterplot then add the additional plots in the margins?
2005 Jun 14
2
Prebuffering best practices
Ok, this is a silly question, but what does the jitter buffer do? I'm
really new to audio, so please bear with me.
From what I gather (primarily from the list archive), the jitter buffer
is a wrapper around the Speex decoder. I give it the packets I receive,
in whatever order I receive them, and then it gives me back a clean
stream of audio samples. But what I don't entirely
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
2009 May 12
4
decimal troubles ?
Dear all,
I have some trouble with the number of decimals in R (currently R
2.9.0). For instance:
> options()$digits
[1] 3
let me hope that I will get three digits where useful when a number is
printed. BUT:
> 44.25+31.1+50
[1] 125
No way to get the right result 125.35
Can anybody tell me what's happens ?
Patrick
2007 Sep 06
2
larger decimal numbers get rounded ....
Hi,
I am sure there is a reason but ...... why larger decimal numbers get rounded to the nearest integer?
Example:
a <- 3308000.5
a
[1] 3308001
I would like my numbers to be decimals .... since they do represent coordinates and i don't want them rounded .... how can i keep them as they are?
Thanks,
Monica
_________________________________________________________________