Skip to content

Commit ca36cc1

Browse files
committed
Improved detailed shared text
1 parent aef3f47 commit ca36cc1

1 file changed

Lines changed: 7 additions & 6 deletions

File tree

SplitBill/splitBill.html

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -511,12 +511,13 @@ <h3>Persons:</h3>
511511
const totalDiff = (itemsPrice - personsPrice).formatPrice();
512512
const text = data.persons.flatMap(person => [
513513
`${person.name}: ${calculatePersonTotal(person).formatPrice()}${person.paid ? ' (paid)' : ''}`,
514-
...(!detailed ? [] :
515-
// keep order from data.items array
516-
data.items.map(item => [item, getAmount(person, item)])
517-
.filter(e => e[1] != 0)
518-
.map(([item, amount]) => ` - ${item.name}${amount == 1 ? '' : ` (${amount})`}: ${(item.price*amount).formatPrice()}`)
519-
)
514+
...(!detailed ? [] : [
515+
// keep order from data.items array
516+
...data.items.map(item => [item, getAmount(person, item)])
517+
.filter(e => e[1] != 0)
518+
.map(([item, amount]) => ` - ${item.name}${amount == 1 ? '' : ` (${amount.formatPrice()})`}: ${(item.price*amount).formatPrice()}`),
519+
"",
520+
])
520521
]).join("\n") + (
521522
totalDiff > 0 ? `\nUnknown: ${totalDiff}` :
522523
totalDiff < 0 ? `\nExtra: ${-totalDiff}` :

0 commit comments

Comments
 (0)