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

View File

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