Last active
December 16, 2015 16:29
-
-
Save jamesthompson/5463627 to your computer and use it in GitHub Desktop.
implicit class / value class
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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