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 trialLucas Peters
Courses Plus Student 1,003 PointsSwift calculator
Hello, I'm building a calculator in swift... I want add pi and comma when I do this it gives me an error..
How do I do this?
Thank you
Code:
@IBAction func btnPiPressed(_ sender: UIButton) {
}
@IBAction func btnDecimalPress(_ sender: UIButton) {
}
2 Answers
Lucas Peters
Courses Plus Student 1,003 PointsIn the Pi function I tried this: handleInput(M_PI), cannot convert value of type 'double' to expected argument type 'string' I understand the error but just don't know how to fix it....
For the comma function I tried lots of different things but at all the comma button isn't doing anything in the simulator.
Pretty hard to explain, I hope this is enough info
Thank you
Lucas Peters
Courses Plus Student 1,003 PointsCan somebody please give me an answer?
Martin Wildfeuer
Courses Plus Student 11,071 PointsMartin Wildfeuer
Courses Plus Student 11,071 PointsHey there! Please let us know what the error is. :) does it crash? Can you give us the console output to this error? Thanks!