...
This commit is contained in:
@@ -14,4 +14,18 @@ object MarketUtil {
|
||||
return now.isAfter(start) && now.isBefore(end)
|
||||
}
|
||||
|
||||
fun roundToTickSize(price: Double): Double {
|
||||
val tick = when {
|
||||
price < 2000 -> 1.0
|
||||
price < 5000 -> 5.0
|
||||
price < 20000 -> 10.0
|
||||
price < 50000 -> 50.0
|
||||
price < 200000 -> 100.0
|
||||
price < 500000 -> 500.0
|
||||
else -> 1000.0
|
||||
}
|
||||
// 가장 가까운 호가 단위로 반올림
|
||||
return Math.round(price / tick) * tick
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user