From e7ea36132d4514cc7e01a4bf7e1657b8bc4c9199 Mon Sep 17 00:00:00 2001 From: midblep Date: Tue, 24 May 2022 19:16:28 +0200 Subject: [PATCH] make total functional --- src/lib/calculator/Calculator.svelte | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/lib/calculator/Calculator.svelte b/src/lib/calculator/Calculator.svelte index d9da0db..8cdf3c8 100644 --- a/src/lib/calculator/Calculator.svelte +++ b/src/lib/calculator/Calculator.svelte @@ -2,8 +2,8 @@ import Button from "$lib/header/Button.svelte"; import { onMount } from "svelte"; import words from "$lib/en-lang.json"; -import { base } from "$app/paths"; + let total = 0; let lang = words["calculator"]; let types = lang["types"]; @@ -115,6 +115,11 @@ import { base } from "$app/paths"; } }); } + + total = 0; + commissions.forEach(value => { + total += value.price; + }) } async function load() { @@ -164,7 +169,7 @@ import { base } from "$app/paths";

Total

-

$20

+

{total}

This figure is an estimate, the final price may differ.
All commissions are strictly SFW only.