Function elma::time_format [] [src]

pub fn time_format(time: i32) -> Result<String, ElmaError>

Converts the string-as-i32 times in top10 list to strings.

Examples

Thanks to the genious data structure in Elma files, the best times in a level are represented visually as a string, but stored as a i32. This function will convert the i32 time to a string formatted as "00:00,00".

let time: i32 = 2039;
let formatted = elma::time_format(time).unwrap();
assert_eq!("00:20,39", formatted);