# Values mix up

**URL:** <https://www.ruby-forum.com/t/values-mix-up/195585>\
**Category:** Ruby\
**Created:** [September 26, 2010, 1:54am UTC](https://www.ruby-forum.com/t/values-mix-up/195585 "2010-09-26T01:54:59Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jake\_1637](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/a88e4f/32.png) [@jake\_1637](https://www.ruby-forum.com/u/jake_1637)\
**Post date:** [September 26, 2010, 1:54am UTC](https://www.ruby-forum.com/t/values-mix-up/195585/1 "2010-09-26T01:54:59Z")

</div>

Hi I’m just starting to use ruby and I’m stuck on a homework assignment  
for class  
My problem is   
dollars = tempEntry.text.to\_f

rate = tempEntry.text.to\_f

time = tempEntry.text.to\_f

fv = dollars\*(1+rate)\*\*time

output= " In " + time.to\_s + " years your investment will be worth " +  
fv.to\_s

resultLabel.set\_label( output )

the dollars value takes the time values place  
if anyone could help i would really appreciate it

---

<div class="post-metadata">

**Author:** ![jake\_1637](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/a88e4f/32.png) [@jake\_1637](https://www.ruby-forum.com/u/jake_1637)\
**Post date:** [September 26, 2010, 8:49am UTC](https://www.ruby-forum.com/t/values-mix-up/195585/2 "2010-09-26T08:49:56Z")

</div>

Jake Alucard wrote:

> Hi I’m just starting to use ruby and I’m stuck on a homework assignment  
> for class  
> My problem is   
> dollars = tempEntry.text.to\_f
> 
> rate = tempEntry.text.to\_f
> 
> time = tempEntry.text.to\_f
> 
> fv = dollars\*(1+rate)\*\*time
> 
> output= " In " + time.to\_s + " years your investment will be worth " +  
> fv.to\_s
> 
> resultLabel.set\_label( output )

That’s not a problem; it’s an incomplete piece of code. (We have no idea  
what tempEntry is, for example)

A problem might be “it produces the value 8 when I expected it to  
produce the value 5”, or “it raises the following exception …” with a  
complete copy-paste of the exception.

I think you’re trying to say something with “the dollars value takes the  
time values place”, but what that means, I have no idea.

For advice on how to write questions which are more likely to get a  
helpful answer, read  
[http://www.catb.org/~esr/faqs/smart-questions.html#intro](http://www.catb.org/~esr/faqs/smart-questions.html#intro)
