12 lines
280 B
Kotlin
12 lines
280 B
Kotlin
package com.infendro.cli.parser
|
|
|
|
import com.infendro.cli.exception.run.ParseException
|
|
|
|
object FloatParser : Parser<Float> {
|
|
override fun parse(text: String): Float = try {
|
|
text.toFloat()
|
|
} catch (_: Exception) {
|
|
throw ParseException(text, "Float")
|
|
}
|
|
}
|