summaryrefslogtreecommitdiffstats
path: root/donation-calc
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2018-01-17 00:18:59 -0500
committerDrew DeVault <sir@cmpwn.com>2018-01-17 00:18:59 -0500
commit0c4d69d742ba3e227cc8feca85594a7c568e42ee (patch)
treeca2f00e7c9015f3c5af18e9f3406afe244ea8fb6 /donation-calc
parent1101034713d5af153fd46da939ab5f50bd76400e (diff)
Fix braindead withdrawl fee calculation
Diffstat (limited to 'donation-calc')
-rw-r--r--donation-calc/index.js13
1 files changed, 7 insertions, 6 deletions
diff --git a/donation-calc/index.js b/donation-calc/index.js
index b3abcf3..7d6aee2 100644
--- a/donation-calc/index.js
+++ b/donation-calc/index.js
@@ -60,7 +60,7 @@ class Calculator extends Component {
<tbody>
<tr>
<td>Stripe fee</td>
- <td>2.9% + 30c</td>
+ <td>2.9% + 30¢</td>
<td
style={{ textAlign: "right" }}
>${stripe.toFixed(2)}</td>
@@ -123,7 +123,7 @@ class Calculator extends Component {
"debit": "Debit",
};
const humanInFee = {
- "card-usd": "2.925%+35c",
+ "card-usd": "2.925%+35¢",
"card-euro": "2.106%+€0.21",
"wire": "0.585%",
"debit": "€0.59",
@@ -156,7 +156,7 @@ class Calculator extends Component {
checked={inMethod === "card-usd"}
onChange={e => this.setState({ inMethod: "card-usd" })}
/>
- Card - USD (2.925%+35c)
+ Card - USD (2.925%+35¢)
</label>
<label class="radio-inline">
<input
@@ -428,7 +428,7 @@ class Calculator extends Component {
<tbody>
<tr>
<td>Transaction fee</td>
- <td>2.9% + 30c</td>
+ <td>2.9% + 30¢</td>
<td
style={{ textAlign: "right" }}
>(${tx_fee.toFixed(2)})</td>
@@ -455,7 +455,8 @@ class Calculator extends Component {
const share = (amt / total) * (total - tx_fee);
const patreon_fee = share * 0.05;
const after_patreon = share - patreon_fee;
- const clamp = (value, min, max) => Math.min(Math.max(value));
+ const clamp = (value, min, max) =>
+ Math.min(Math.max(min, value), max);
const withdrawl_fee = clamp(after_patreon * 0.01, 0.25, 20);
const creator_total = after_patreon - withdrawl_fee;
return [
@@ -491,7 +492,7 @@ class Calculator extends Component {
</tr>,
<tr>
<td>Withdrawl fee*</td>
- <td>1% (25c min, $20 max)</td>
+ <td>1% (25¢ min, $20 max)</td>
<td
style={{ textAlign: "right" }}
>(${withdrawl_fee.toFixed(2)})</td>