mirror of
https://github.com/eitchtee/WYGIWYH.git
synced 2026-02-25 00:44:52 +01:00
Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7816d6c55d | ||
|
|
6e3fdae4fe | ||
|
|
e2da996217 | ||
|
|
cc2e2293ed | ||
|
|
7060f07ccd | ||
|
|
0adb991879 | ||
|
|
20e03df661 | ||
|
|
71f59bfd68 |
@@ -58,8 +58,8 @@
|
||||
<div class="vr mx-3 tw-align-middle"></div>
|
||||
<div class="btn-group"
|
||||
_="on selected_transactions_updated from #actions-bar
|
||||
set realTotal to 0.0
|
||||
set flatTotal to 0.0
|
||||
set realTotal to math.bignumber(0)
|
||||
set flatTotal to math.bignumber(0)
|
||||
set transactions to <.transaction:has(input[name='transactions']:checked)/>
|
||||
set flatAmountValues to []
|
||||
set realAmountValues to []
|
||||
@@ -70,27 +70,28 @@
|
||||
append amountValue to flatAmountValues
|
||||
|
||||
if not isNaN(amountValue)
|
||||
set flatTotal to flatTotal + (amountValue * 100)
|
||||
set flatTotal to math.chain(flatTotal).add(amountValue)
|
||||
|
||||
if transaction match .income
|
||||
append amountValue to realAmountValues
|
||||
set realTotal to realTotal + (amountValue * 100)
|
||||
set realTotal to math.chain(realTotal).add(amountValue)
|
||||
else
|
||||
append -amountValue to realAmountValues
|
||||
set realTotal to realTotal - (amountValue * 100)
|
||||
set realTotal to math.chain(realTotal).subtract(amountValue)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
set realTotal to realTotal / 100
|
||||
set flatTotal to flatTotal / 100
|
||||
|
||||
set mean to flatTotal.divide(flatAmountValues.length).done().toNumber()
|
||||
set realTotal to realTotal.done().toNumber()
|
||||
set flatTotal to flatTotal.done().toNumber()
|
||||
|
||||
put realTotal.toLocaleString(undefined, {minimumFractionDigits: 0, maximumFractionDigits: 40}) into #real-total-front's innerText
|
||||
put realTotal.toLocaleString(undefined, {minimumFractionDigits: 0, maximumFractionDigits: 40}) into #calc-menu-real-total's innerText
|
||||
put flatTotal.toLocaleString(undefined, {minimumFractionDigits: 0, maximumFractionDigits: 40}) into #calc-menu-flat-total's innerText
|
||||
put Math.max.apply(Math, realAmountValues).toLocaleString(undefined, {minimumFractionDigits: 0, maximumFractionDigits: 40}) into #calc-menu-max's innerText
|
||||
put Math.min.apply(Math, realAmountValues).toLocaleString(undefined, {minimumFractionDigits: 0, maximumFractionDigits: 40}) into #calc-menu-min's innerText
|
||||
put (flatTotal / flatAmountValues.length).toLocaleString(undefined, {minimumFractionDigits: 0, maximumFractionDigits: 40}) into #calc-menu-mean's innerText
|
||||
put mean.toLocaleString(undefined, {minimumFractionDigits: 0, maximumFractionDigits: 40}) into #calc-menu-mean's innerText
|
||||
put flatAmountValues.length.toLocaleString(undefined, {minimumFractionDigits: 0, maximumFractionDigits: 40}) into #calc-menu-count's innerText
|
||||
end"
|
||||
>
|
||||
|
||||
@@ -69,8 +69,7 @@
|
||||
then call math.evaluate(expr)
|
||||
if result exists and result is a Number
|
||||
js(result)
|
||||
return result.toString().replace(new RegExp(',|\\.', 'g'),
|
||||
match => match === '.' ? window.decimalSeparator : window.argSeparator)
|
||||
return result.toLocaleString(undefined, {minimumFractionDigits: 0, maximumFractionDigits: 40})
|
||||
end
|
||||
then set localizedResult to it
|
||||
set #calculator-result.innerText to localizedResult
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
{% block title %}{% if type == "current" %}{% translate 'Current Net Worth' %}{% else %}{% translate 'Projected Net Worth' %}{% endif %}{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="container px-md-3 py-3" _="on load call initializeAccountChart() then initializeCurrencyChart()">
|
||||
<div class="container px-md-3 py-3" _="init call initializeAccountChart() then initializeCurrencyChart() end">
|
||||
<div class="row gx-xl-4 gy-3 mb-4">
|
||||
<div class="col-12 col-xl-5">
|
||||
<div class="row row-cols-1 g-4">
|
||||
|
||||
Reference in New Issue
Block a user