P
pood.forums
alright, this seems easy enough.
Building a Bank class, deposits must be floating, so if it has any
letters, it will tell the user it needs numbers
if amount == /^[0-9]$/
deposit_to_acct(amount,current_account)
puts 'You have deposited ' + amount.to_s
else
puts 'Must be a number, alphabet bank is next door to your
right'
end
it goes straight to the else statement, never executes the
deposit_to_acct method.
What part am I doing wrong?
Building a Bank class, deposits must be floating, so if it has any
letters, it will tell the user it needs numbers
if amount == /^[0-9]$/
deposit_to_acct(amount,current_account)
puts 'You have deposited ' + amount.to_s
else
puts 'Must be a number, alphabet bank is next door to your
right'
end
it goes straight to the else statement, never executes the
deposit_to_acct method.
What part am I doing wrong?