Skip to content

Instantly share code, notes, and snippets.

@jamesthompson
Last active December 16, 2015 16:29
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 jamesthompson/5463627 to your computer and use it in GitHub Desktop.
Save jamesthompson/5463627 to your computer and use it in GitHub Desktop.
implicit class / value class
implicit class Meter(val num: Double) extends AnyVal {
def m : Double = num
def mm : Double = num / 1e3
def um : Double = num / 1e6
def nm : Double = num / 1e9
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment