Displaying 20 results from an estimated 3000 matches similar to: "money data types"
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
2010 Feb 24
6
[OT?] recommendation for simple wiki S/W to run on centos 5.4?
any testimonials for some simple wiki software to run on centos 5.4
on an intranet? all i'm after is something uncomplicated that
(ideally) yum installs, and that others can start using to start
sharing useful info, nothing more. thoughts?
rday
--
========================================================================
Robert P. J. Day Waterloo, Ontario,
2011 Oct 12
1
scopes related question
Hello,
Have a question related scope definition. I need to define a scope
based on related model attribute values like this.
class Product < ActiveRecord::Base
belongs_to :currency
scope :with_currency, lambda { |currency|
unless currency.to_s.upcase == ''ALL''
# here I need to define a scope that would test for currency.char_code
to match a passed value
# something
2006 May 05
2
dovecot LDA w/virtual domains and postfix
Hi,
I've been trying to follow the documentation that I am finding, but am running
into trouble getting things set up correctly for postfix + virtual domains
(using ldap) with dovecot LDA. I can get it to work without LDA, but I'm
running into permissions problems when I try to run with LDA. I am wondering
if anyone has any good examples of configuring this.
I basically have a
2003 Oct 19
2
Bagplot
Has anyone ported the Bagplot function by Rousseeuw, Ruts, and Tukey from S
to R? The S function comprises a script and a FORTRAN function. I assume
porting is relatively uncomplicated, but since I have not done any porting
before I would not want to invest the effort if a port is readily available.
2011 Jan 07
1
Calculating Returns : (Extremely sorry for earlier incomplete mail)
Dear R forum helpers,
I am extremely sorry for the receipt of my incomplete mail yesterday. There was connectivity problem at my end and so I chose to send the mail through my cell, only to realize today about the way mail has been transmitted. I am again sending my complete mail through regular channel and sincerely apologize for the inconvenience caused.
## Here is my actual mail
Dear R
2008 Jun 29
2
How to write test about validates_associated
Here is my model:
class Account < ActiveRecord::Base
has_many :users, :dependent => :destroy
has_many :bus
belongs_to :currency
has_many :mylogs, :dependent => :destroy
has_many :batchuserdefines, :dependent => :destroy
has_many :materialuserdefines, :dependent => :destroy
has_many :materials
has_many :inventories
has_many :batchs
has_many :courses
has_many
2006 Mar 03
1
number_to_currency() helper == non DRY == could be improved
Hi all,
Apologies in advance if I got this one wrong, I''m still just a
newbie ;-)
Going through the Apple ADC RoR tutorial it suddenly occurred to me
that the ''number_to_currency()'' helper method was not DRY streamlined.
Scenario::
The "number_to_currency()" methods options hash works great when I
need to dynamically display different currencies when I
2013 Apr 03
4
Better way of writing R code
Dear R forum,
(Pl note this is not a finance problem)
I have two data.frames as
currency_df = data.frame(current_date = c("3/4/2013", "3/4/2013", "3/4/2013", "3/4/2013"), issue_date = c("27/11/2012", "9/12/2012", "14/01/2013", "28/02/2013"), maturity_date = c("27/04/2013", "3/5/2013",
2006 Mar 25
4
Rails PayPal and Currencies other than USD
Has anyone been able to make direct API calls to PayPal in currencies
other than USD? I get an error message "The currency code submitted is
not supported. Check the currency code and try again."
I''m using the PayPal plugin for Rails. I can successfully transact in
USD, but not AUD (Australian Dollars).
Cheers,
Dan
2011 Jan 07
1
Currency return calculations
Dear sir, I am extremely sorry for messing up the logic
asking for help w.r.t. my earlier mails
I have tried to explain below what I am looking for.
I have a database (say, currency_rates) storing datewise
currency exchange rates with some base currency XYZ.
currency_rates <- data.frame(date =
c("12/31/2010", "12/30/2010", "12/29/2010",
2013 Apr 25
1
Linear Interpolation : Missing rates
Dear R forum
I have data.frame as
df = data.frame(rate_name = c("USD_1w", "USD_1w", "USD_1w", "USD_1w", "USD_1m", "USD_1m", "USD_1m", "USD_1m", "USD_2m", "USD_2m", "USD_2m", "USD_2m", "GBP_1w", "GBP_1w", "GBP_1w", "GBP_1w",
2013 Apr 16
3
Splitting the Elements of character vector
Dear R forum
I have a data.frame
df = data.frame(currency_type = c("EURO_o_n", "EURO_o_n", "EURO_1w", "EURO_1w", "USD_o_n", "USD_o_n", "USD_1w", "USD_1w"), rates = c(0.47, 0.475, 0.461, 0.464, 1.21, 1.19, 1.41, 1.43))
currency_type rates
1 EURO_o_n 0.470
2 EURO_o_n 0.475
3 EURO_1w 0.461
2011 Sep 07
6
FactoryGirl doesnt produce unique names?!
Hey,
I got following very simple test case:
require ''spec_helper''
describe Country do
it "should create a new instance given valid attributes" do
Factory(:country)
end
end
Factory looks like:
Factory.sequence :country_name do |n|
"Country #{n}"
end
Factory.define :country do |c|
c.name Factory.next(:country_name)
c.nationality "Foo
2014 May 16
9
Centos backup tools
Hi all!
I'm building a raid box to use for backups, connectivity will be either
USB3 or esata.
Looking for suggestions on backup software I can use.
I know there's rsync, which may be a good solution. I also find backupPC
at epel, backintime also at epel, kbackup.
DejaDup looks interesting, but none of the repos I'm set up to use
shows it being available.
some small details: I
2007 May 15
3
NOOB question RSPEC
Hi all !!
I have this code:
require ''account''
describe Account, "when first created" do
before do
@account = Account.new
end
it "should have a balance of $0" do
@account.balance.should eql(Money.new(0, :dollars))
end
after do
@account = nil
end
end
How can I pass the @account.balance.should eql(Money.new(0, :dollars))
spec. From my
2006 Jul 21
3
[Slightly OT] CSS with wildcard?
Sorry if this is a simple question, I''m a CSS noob.
I have a rails app that is displaying posts, I am having it generate
each post with its own div like "post_19", "post_20", etc.
I could make it so it puts another div around that div (i need the
individual post div''s for deletion with AJAX) but would rather not.
Is there some way to use CSS to do
2007 Feb 13
2
Computing stats on common parts of multiple dataframes
Folks,
I have three dataframes storing some information about
two currency pairs, as follows:
R> a
EUR-USD NOK-SEK
1.23 1.33
1.22 1.43
1.26 1.42
1.24 1.50
1.21 1.36
1.26 1.60
1.29 1.44
1.25 1.36
1.27 1.39
1.23 1.48
1.22 1.26
1.24 1.29
1.27 1.57
1.21 1.55
1.23 1.35
1.25 1.41
1.25 1.30
1.23 1.11
1.28 1.37
1.27 1.23
R> b
EUR-USD NOK-SEK
1.23 1.22
1.21 1.36
1.28 1.61
1.23 1.34
1.21 1.22
2012 Aug 17
3
Rails doesn't validate create_model or build_model (has_one association)
I''ve got User has_one Shop. Rails is not validating when I tried
create_shop or build_shop, neither in the browser nor the rails console.
My code:
class Shop < ActiveRecord::Base
attr_protected :user_id
belongs_to :user
validates_presence_of :name, :primary_address, :city, :country_code,
:currency
end
class ShopsController < ApplicationController
before_filter
2010 Feb 24
2
How to read percentage and currency data?
I'm struggling to find any help on this seemingly simple question - how does
one read data with percentage (%) or currency (?,$ etc.) signs? When I try
to read a data file which has any of those symbols in the data fields, they
are read as characters rather than values. Is there a function or library
which can deal with such values?
As an example, I use this sample from one of chinna's