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! While you're at it, check out some resources Treehouse students have shared here.
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 trialSuleiman Abdulmumini
388 Pointsis 9.99 not a double?
i was asked to create a constant 'price' and and give a value of 9.99 but when i did it i was told that 9.99 is supposed to be a double but it isn't and an example of a double is 6.99. i really didn't understand the question i need some help
let title = "A Dance with Dragons"
let price = "9.99."
2 Answers
Nathan Tallack
22,160 Points9.99 could also be a Float. ;)
But in your case you putting it inside of the quotes makes it a String.
Try:
let price: Double = 9.99
Suleiman Abdulmumini
388 Pointsthanks chap it worked