Created
May 14, 2022 13:56
-
-
Save enginebai/31f4371ebd6f71bb8df9fff39bafbff5 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
class Ticker { | |
val lastClosePrice = ... | |
fun refreshRealTimePrice(price: Double) { | |
val displayColor = when { | |
price < lastClosePrice: Colors.GREE | |
price > lastClosePrice: Colors.RED | |
price = lastClosePrice: Colors.WHITE | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment