FYI, there are some libraries for Kotlin that support units of measure that may be of use to you. E.g.: