Skip to content

Commit fcceebf

Browse files
committed
consistency
1 parent 5d9c34b commit fcceebf

1 file changed

Lines changed: 6 additions & 7 deletions

File tree

SplitBill/splitBill.html

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ <h1>Split bill</h1>
1616
<p>
1717
Personal tool made by <a href="https://github.com/TrianguloY">TrianguloY</a> to split a bill into different persons without using excel/sheets.
1818
<br>
19-
Add items, add persons, fill what each person used, and get the amount.
19+
Add items, add persons, fill what each person used, and get the total price each one should pay.
2020
<br>
2121
No ads, no nonsense, just the tool. Any suggestion is welcomed! Source code available at <a href="https://github.com/TrianguloY/githubPages/tree/master/SplitBill">Github</a>
2222
</p>
@@ -336,7 +336,7 @@ <h3>Persons:</h3>
336336
function splitEqually(itemId) {
337337
const amount = data.items.find(byId(itemId)).amount / data.persons.length;
338338
data.persons.forEach(person => {
339-
person.amounts[itemId] = amount
339+
person.amounts[itemId] = amount;
340340
});
341341
fill();
342342
}
@@ -373,7 +373,6 @@ <h3>Persons:</h3>
373373
}
374374

375375
function selectNext(event, element){
376-
console.log(event)
377376
if(event.key !== "Enter") return;
378377

379378
element.classList.add("searching");
@@ -405,7 +404,7 @@ <h3>Persons:</h3>
405404
${data.persons.map(person=>`<div id="id_${item.id}_${person.id}" class="flex">
406405
<button onclick="centerById(${person.id})">&gt;</button>
407406
<input class="personName" type="text" value="" oninput="changePersonName(this, ${person.id})" onkeydown="selectNext(event, this)" />
408-
<span>Amount:</span>
407+
<span>Qty:</span>
409408
<input class="personAmount selectable" type="number" onchange="changePersonAmount(this, ${person.id}, ${item.id})" onkeydown="selectNext(event, this)" min="0" step="any" value="" />
410409
<button onclick="increasePersonAmount(${person.id}, ${item.id}, 1)">+</button>
411410
<button onclick="increasePersonAmount(${person.id}, ${item.id}, -1)">-</button>
@@ -426,7 +425,7 @@ <h3>Persons:</h3>
426425
${data.items.map(item =>`<div id="id_${person.id}_${item.id}" class="flex">
427426
<button onclick="centerById(${item.id})">&gt;</button>
428427
<input class="itemName" type="text" value="" oninput="changeItemName(this, ${item.id})" onkeydown="selectNext(event, this)" />
429-
<span>Amount:</span>
428+
<span>Qty:</span>
430429
<input class="personAmount selectable" type="number" onchange="changePersonAmount(this, ${person.id}, ${item.id})" onkeydown="selectNext(event, this)" min="0" step="any" value="" />
431430
<button onclick="increasePersonAmount(${person.id}, ${item.id}, 1)">+</button>
432431
<button onclick="increasePersonAmount(${person.id}, ${item.id}, -1)">-</button>
@@ -470,8 +469,8 @@ <h3>Persons:</h3>
470469
});
471470
const itemPending = calculateItemPending(item);
472471
parent.querySelector(".itemPending").innerText =
473-
itemPending > 0 ? `There is still ${itemPending} amount to assign` :
474-
itemPending < 0 ? `There is an extra ${-itemPending} amount` :
472+
itemPending > 0 ? `There is still ${itemPending} quantity to assign` :
473+
itemPending < 0 ? `There is an extra ${-itemPending} quantity` :
475474
"Item assigned";
476475
parent.style.backgroundColor =
477476
item.price == 0 ? "lightgrey" :

0 commit comments

Comments
 (0)