Time spend presenter more digits (#3813)

Signed-off-by: Denis Bykhov <bykhov.denis@gmail.com>
This commit is contained in:
Denis Bykhov 2023-10-09 13:38:04 +06:00 committed by GitHub
parent 3b6946abc7
commit 3f7dc53656
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View File

@ -29,13 +29,13 @@
on:click
use:tooltip={{
component: Label,
props: { label: tracker.string.TimeSpendHours, params: { value: floorFractionDigits(value, 1) } }
props: { label: tracker.string.TimeSpendHours, params: { value: floorFractionDigits(value, 2) } }
}}
>
{#if noSymbol}
{floorFractionDigits(value, 1)}
{floorFractionDigits(value, 2)}
{:else if value > 0 && value < 8}
<Label label={tracker.string.TimeSpendHours} params={{ value: floorFractionDigits(value, 1) }} />
<Label label={tracker.string.TimeSpendHours} params={{ value: floorFractionDigits(value, 2) }} />
{:else}
<Label label={tracker.string.TimeSpendValue} params={{ value: floorFractionDigits(value / 8, 3) }} />
{/if}

View File

@ -133,7 +133,7 @@ function floorFractionDigits (n: number | string, amount: number): number {
function toTime (value: number): string {
if (value > 0 && value < 8) {
return `${floorFractionDigits(value, 1)}h`
return `${floorFractionDigits(value, 2)}h`
} else {
return `${floorFractionDigits(value / 8, 3)}d`
}