Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(calculation): improved accuracy of the calculation #11

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@
</head>
<body>
<p>
Avec une fortune de
<span id='netWorth'>214&nbsp;000&nbsp;000&nbsp;000&nbsp;€</span>,
Avec un revenu de
<span id='netWorth'>2&nbsp;900&nbsp;000&nbsp;000&nbsp;€</span> cette année,
<br />
Bernard Arnault donne
<span id='donation'>10&nbsp;millions</span>
aux Restos du Cœur.
</p>
<br /><br />
<p id='part2'>
Avec votre patrimoine de
Avec votre revenu annuel de
<input id='yourNetWorth' type='number' value='0' autocomplete='off'>&nbsp;€,
<br />
c'est comme si vous donniez
Expand Down
2 changes: 1 addition & 1 deletion script.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ document.addEventListener("DOMContentLoaded", () => {
yourNetWorth.addEventListener("input", (e) => {
const yourNetWorthValue = +e.target.value;

const equivalentDonation = yourNetWorthValue / 21400;
const equivalentDonation = yourNetWorthValue / 290;
donationAmount.innerHTML = `${parseFloat(
equivalentDonation.toFixed(2)
).toLocaleString()}&nbsp;€`;
Expand Down