similar to: Ruby on AIX?

Displaying 20 results from an estimated 30000 matches similar to: "Ruby on AIX?"

2006 Apr 09
16
Mapping to BigDecimals instead of Floats
Hi everyone, I''m new to Rails and Ruby, and have been working my way through the Pickaxe and Agile Rails books for the last week or so. With a background in payroll apps I found that the default ActiveRecord mapping of decimal columns to float variables really bothered me! Financial calcs need high levels of accuracy and floats just don''t give you that. I know there are a bunch
2006 Feb 28
12
Examples for Money library ?
Can anybody share some examples of their Money implementation ? I''m trying to setup a Model to use this library, but can''t seem to wrap my head around how it is exactly supposed to work. My Model (Foo) looks like: =============== composed_of :commission, :class_name => "Money", :mapping => [ %w(commission_cents cents), %w(commission_currency currency) ] Yet, in
2006 Jun 12
6
Storing "money" in databases
Hiall, I''m wondering what''s common practice when dealing with money values stored in databases. I like the idea of storing all the values as integers, i.e. all the values in eurocents not euros. Then I need to multiply all values the users enter by 100 before storing them in the database. Now the question is, what''s the most efficient and dryest way to do this?
2006 Jul 09
6
Float -> BigDecimal
So, I''m personally cool with this change (patch from #5454, applied in [4596]), and I''ll make it work for Oracle tomorrow. But just wondering if folks considered the performance impact of the change? From a simple test it seems that BigDecimal math is about twice as slow as using Floats.
2006 Jun 18
13
Currency calculation
I''m thinking of experimenting with some currency conversion. However, I''d like the conversions to be in synch with the current rates. Anyone know (and this maybe out in left field) if there is some online (perhaps xml) or other data stream I can connect with in my code to output values based on user selection ? TIA Stuart
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 Mar 19
4
Trouble with composed_of
I''m trying to use composed_of within my model. I have a field in my database named ''card1'', which is simply a string. I have this in my model class Player < ActiveRecord::Base composed_of :card1, :class_name => ''Card'' end class Card attr_reader :value, :suit def initialize(s) @value = s[0].chr @suit = s[1].chr end end The
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
2009 Feb 03
4
Ruby EE: Problem with BigDecimal
I have a strange problem with my setup of Passenger and Ruby Enterprise Edition. Sometimes the loading of BigDecimals from the database and session fails (silently) and the variable containing the BigDecimal is just empty. I cannot pinpoint where/when/how it happens, and it IS only periodic. I am using the newest versions of both Passenger and REE - I have even tried to run with latest commit
2009 Jan 16
1
Aggregation: problem with uninitialized composed_of object
Hi, I''m getting this error: >> p = Plan.new >> p.amount TypeError: wrong argument type String (expected Fixnum) Apparently this happens because the aggregation isn''t initialized. Here''s the code: class Plan < ActiveRecord::Base composed_of :amount, :class_name => "Money", :converter => Proc.new { |s|
2006 Jun 08
7
The Agile Book Messageboard?
Hello. Where is there an Agile Messageboard? On the first part of the Depot example, a price field shouldn''t be an integer right? (it should be more of a float since a price has decimals) Dominic Son -- Posted via http://www.ruby-forum.com/.
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 Mar 16
5
TimeZone, TZInfo, daylight savings, and composed_of
Does anyone know the best way to track time zone information. There doesn''t seem to be much documentation on this. So far it seems like a simple db field like create table accounts ( id int unsigned not null auto_increment, name varchar(50) not null, time_zone varchar(50) not null, ... primary key (id) ) and a class like class Account < AR ...
2006 Feb 27
1
Trouble Ticketing Systems written in Ruby
Dear All, do you have any experiences with trouble ticketing systems written for RoR? Best regards, Karl
2006 Mar 31
6
BigDecimal + Float => Float?
I was just playing around in irb and noticed that while BigDecimal + Integer => BigDecimal, BigDecimal + Float => Float. Is there any reason for this? It seems inconsistent and means you have to check the class of any number you add to a BigDecimal, which looks very un-Ruby-like to me. Ashley
2006 Feb 10
36
Advocating RoR in the enterprise?
Hi folks, I''m looking for advice on how to promote RoR in my workplace. Specifically, I''d like to work out a strategy for promoting development in Rails as a new alternative to our existing technology (the usual suspects... mostly Java/Oracle, .NET, PHP, and a bit of Perl here and there). Some background: I work for a fairly large state environmental agency as a web developer.
2006 May 08
2
Creating a "Foo has_many bars" association where bar isn''t a model.
Hi Let''s say we have model Foo. Each Foo instance can have several bars. Those bars are primitive, so they shouldn''t be models. For example, Foo might be a type of convention, and the bars might be years the convention was held in. Naively, we would have a conventions_years date, and put: has_many :years inside class Convention. But then we''d get an error, since for
2006 Feb 18
44
I forgot. Why do we hate* Java?
Hi, I''ve started reading some Java books. Gasp! What makes website development with Java so bad? I haven''t looked at Struts but I''m reading about Hibernate. Compared to ActiveRecord, Hibernate seems like some extra typing to explicitly define the model fields, getters and setters. I know that these are things that you can do in ActiveRecord when things get complicated
2007 Nov 13
4
question about activerecord test_numeric_fields in base_test.rb
There''s a test for activerecord called test_numeric_fields in base_test.rb. here''s the test def test_numeric_fields m = NumericData.new( :bank_balance => 1586.43, :big_bank_balance => BigDecimal("1000234000567.95"), :world_population => 6000000000, :my_house_population => 3 ) assert m.save m1 =
2006 Jul 22
4
Reading floating points into a field stored as Integers
Hi, I''m trying to follow the "AWDR" example of storing certain types of numbers (in my case, percentages not money) as integers in the database. I understand from the Depot application how to format the output to have 2 places (or n places for that matter) decimal. Now, I"m wondering about the input. It''s more natural for people to enter numbers as