Function

formatTimecodeInput

Formats seconds for editable `TimecodeInput` text. Decimal formats are rounded to centiseconds and clamped at zero. Frame formats round to the nearest frame for the supplied frame rate. Use this at UI boundaries after converting from `RationalTime` with `toSeconds`.

Signature

Type Definition
formatTimecodeInput(seconds: number, options: TimecodeFormatOptions = {}): string

Parameters

NameTypeDescription
secondsnumberDecimal seconds to format.
optionsTimecodeFormatOptionsOptional output shape and frame-rate settings.

Returns

string

Timecode text suitable for a `TimecodeInput` value.

Examples

ts Example
formatTimecodeInput(90.5); // "1:30.50"
formatTimecodeInput(90.5, { frameRate: 24 }); // "00:01:30:12"
formatTimecodeInput(60.06, {
frameRate: { numerator: 30000, denominator: 1001 },
dropFrame: true,
}); // "00:01:00;02"