Skip to content

Instantly share code, notes, and snippets.

@drulabs
Last active August 7, 2018 21:05
Show Gist options
  • Save drulabs/a120086002c4b30e9beccec63d7866b4 to your computer and use it in GitHub Desktop.
Save drulabs/a120086002c4b30e9beccec63d7866b4 to your computer and use it in GitHub Desktop.
// Add a function toINR() to kotlin's Double type
fun Double.toINR() = this * oneDollarInINR
// Yes it is a single line function
val netAmountDeposited = 230.0
println("Net amount deposited(in INR): ${netAmountDeposited.toINR()}")
// Did you notice the string interpolation above
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment