Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community!
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.Start your free trial
Jason Smith17,879 Points
I can't seem to figure this code challenge out. I used the to_i to convert a string to an integer but...
We've assigned the string "123" to a variable named string. Take string, use a method to convert it to an integer, and store the result in a variable named integer. Then call a second method on string to convert it to a floating-point number, and store the result in a variable named float.
string = "123".to_i float = "123".to_f
Ari Misha19,323 Points
Hiya there! You're code is right on point infact. But you see you're not following the challenge all the way. It said you need to store converted values in the integer and float respectively. Your code should look like this:
string = "123" integer = string.to_i float = string.to_f