Sexpr tags fixed

This commit is contained in:
Dmitry Boulytchev 2020-08-25 16:09:43 +03:00
parent cbd715339f
commit ac853957ae
6 changed files with 22 additions and 3 deletions

View file

@ -12,3 +12,14 @@ public fun timer () {
time () - t
}
}
-- Formats a given time as a floating-point number
public fun toSeconds (t) {
local s = sprintf ("%d", t);
if s.length >= 7
then
sprintf ("%s.%s", substring (s, 0, s.length - 7 + 1), substring (s, s.length - 7 + 1, 6))
else sprintf ("0.%s", s)
fi
}