Skip to content

Instantly share code, notes, and snippets.

@jasongorman
Created March 27, 2019 10:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jasongorman/d0750e3c44caafacdeb68947467488ea to your computer and use it in GitHub Desktop.
Save jasongorman/d0750e3c44caafacdeb68947467488ea to your computer and use it in GitHub Desktop.
fun carpet(pricePerSqrMetre: Double, roundUp: Boolean): (Double) -> (Double) {
fun price(roomArea : Double) : Double {
var carpetArea = roomArea
if (roundUp)
carpetArea = Math.ceil(carpetArea)
return pricePerSqrMetre * carpetArea
}
return ::price
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment