Skip to content

Commit

Permalink
Merge pull request #74 from autentia/fix/trunc-decimal-in-balance
Browse files Browse the repository at this point in the history
Trunc balance to 2 decimals
  • Loading branch information
Francisco Javier Martínez authored Nov 14, 2022
2 parents c31e096 + 660938c commit b74fb74
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export const WorkingTime = observer(() => {

useEffect(() => {
const hourBalance = (worked ?? 0) - (target ?? 0)
setHourBalance(hourBalance)
setHourBalance(Number(hourBalance.toFixed(2) ?? 0))
setIsNegativeBalance(hourBalance < 0)
}, [worked, target])

Expand Down

0 comments on commit b74fb74

Please sign in to comment.