Hi Jean,

> To get 2-digit precision on the number of seconds, you can simply replace
> 
> (format #f "~as" (round rest))
> 
> with
> 
> (format #f "~,2fs" rest)
> 
> in the format-time function.
> 
> For seconds:frames at 24 frames/second, replace format-time with
> 
>   (define (format-time seconds)
>     (let* ((minutes (euclidean-quotient seconds 60))
>            (rest (euclidean-remainder seconds 60))
>            (seconds (euclidean-quotient rest 1))
>            (rest (euclidean-remainder rest 1)))
>       (string-append (if (zero? minutes) "" (format #f "~a:" minutes))
>                      (format #f "~a:~a" seconds (round (* rest 24))))))

Fantastic!

For future readers: for 0 minutes, 2 seconds, and 8 frames, the formatting 
above will return "2:8". If you [like me] would prefer "0:02:08", then use

      (string-append (format #f "~d:" minutes)
                     (format #f "~2,'0d:~2,'0d" seconds (round (* rest 24))))))

Thanks again, Jean!
Another “wow” feature to show my colleagues who are still toiling away in 
lesser engraving apps.  ;)

Cheers,
Kieren.
______________________________________________

My work day may look different than your work day. Please do not feel obligated 
to read or respond to this email outside of your normal working hours.


Reply via email to