func priceString()

in FriendlyEats/RestaurantsTableViewController.swift [22:36]


func priceString(from price: Int) -> String {
  let priceText: String
  switch price {
  case 1:
    priceText = "$"
  case 2:
    priceText = "$$"
  case 3:
    priceText = "$$$"
  case _:
    fatalError("price must be between one and three")
  }

  return priceText
}