package com.ama.core.common.util

import android.content.res.Resources
import android.util.TypedValue


inline val Int.sp: Int
    get() = toFloat().toSp()

inline val Double.sp: Int
    get() = toFloat().toSp()

inline val Float.sp: Int
    get() = toSp()

fun Float.toSp() = TypedValue.applyDimension(
    TypedValue.COMPLEX_UNIT_SP, this, Resources.getSystem().displayMetrics
).toInt()