Select Git revision
settings_production.py
Forked from
KIF / AKPlanning
Source project has a limited visibility.
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
RowWorkItem.svelte 1.18 KiB
<script lang="ts">
import { calculateE, calculateS, calculateV } from "./estimator";
import { roundOne } from "./utils";
export let a: number
export let b: number
export let c: number;
$: E = ( typeof a !== "number" || typeof b !== "number") ? null : calculateE({a,b,c})
$: S = ( typeof a !== "number" || typeof b !== "number") ? null : calculateS({a,b,c})
$: V = ( typeof a !== "number" || typeof b !== "number") ? null : calculateV({a,b,c})
$: SEPercent = (typeof S !== 'number' || typeof E !== 'number') ? null : (S/E)*100
function hideNull(input: any|null): string {
return input === null ? "-" : ""+input;
}
</script>
<tr>
<td class="tg-0lax">
<input type="number" class="a-input" bind:value="{a}">
</td>
<td class="tg-0lax">
<input type="number" class="c-input" bind:value="{c}">
</td>
<td class="tg-0lax">
<input type="number" class="c-input" bind:value="{b}">
</td>
<td class="tg-0lax">{hideNull(roundOne(E))}</td>
<td class="tg-0lax">{hideNull(roundOne(S))}</td>
<td class="tg-0lax">{hideNull(roundOne(SEPercent))}%</td>
<td class="tg-0lax">{hideNull(roundOne(V))}</td>
</tr>