Current section

Files

Jump to
m3e src m3e number_string.gleam
Raw

src/m3e/number_string.gleam

/// NumberString is an attribute type that can hold either a number or a string.
///
import gleam/float
pub type NumberString {
NumberVal(Float)
StringVal(String)
}
pub fn to_string(n: NumberString) -> String {
case n {
NumberVal(f) -> float.to_string(f)
StringVal(s) -> s
}
}