Skip to content

Commit

Permalink
[desktop]: Fix exposure time formatter
Browse files Browse the repository at this point in the history
  • Loading branch information
tiagohm committed Aug 17, 2024
1 parent 120cb3e commit 51b9f36
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions desktop/src/shared/pipes/exposureTime.pipe.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,9 @@ const secondFormatter = formatter(TWO_DIGITS_FORMATTER, 's')

function format(value: number, factors: [number, number], formatters: [UnitFormatter, UnitFormatter]) {
const a = value / factors[0]
const b = (a - Math.trunc(a)) * factors[1]
return `${formatters[0](a)}${formatters[1](b)}`
const ta = Math.trunc(a)
const b = Math.trunc((a - ta) * factors[1])
return `${formatters[0](ta)}${formatters[1](b)}`
}

function hours(value: number) {
Expand Down

0 comments on commit 51b9f36

Please sign in to comment.