SHARE
TWEET

Swift: currency converter

applehelpwriter Jun 4th, 2014 196 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //swift
  2. //currency converter
  3.  
  4. func poundsToBaht(rate:Int, pounds:Int) -> String{
  5.     let baht = rate*pounds
  6.     return \(pounds) is \(baht) baht."
  7. }
  8.  
  9. func bahtToPounds(rate:Int, baht:Int) -> String{
  10.     let pounds = baht/rate
  11.     return "\(baht) baht is £\(pounds)."
  12. }
  13.  
  14. poundsToBaht(51, 3000)
  15. bahtToPounds(51, 660000)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top