# Pastebin znMpj81v sub renderOLD(Invoice $inv --> Str) is export { use FStrings; qq:to/RENDER/; Invoice: $inv.id() Date: $inv.date() Client: $inv.client() {f('Description' -f 30, 'Hours' +f 6, 'Rate' +f 8, 'Subtotal' +f 10)} { "-" x 58 } $inv.items.map({ f(.description -f 30, .hours +f 6.1, .rate +f 8.2, .subtotal +f 10.2) }).join("\n") { "-" x 58 } {f('Subtotal' +f 46, $inv.subtotal +f 10.2)}, {f($inv.label +f 46, $inv.tax +f 10.2)}, {f('Total' +f 46, $inv.total +f 10.2)}; RENDER } sub renderOLD2(Invoice $inv --> Str) is export { use FStrings; qq:to/RENDER/; Invoice: $inv.id() Date: $inv.date() Client: $inv.client() &sprintf("%-30s %6s %8s %10s", "Description", "Hours", "Rate", "Subtotal") { "-" x 58 } $inv.items.map({ sprintf("%-30s %6.1f %8.2f %10.2f", .description, .hours, .rate, .subtotal ) }).join("\n") { "-" x 58 } &sprintf("%46s %10.2f", "Subtotal", $inv.subtotal) &sprintf("%46s %10.2f", $inv.label, $inv.tax) &sprintf("%46s %10.2f", "Total", $inv.total) RENDER } sub render(Invoice $inv --> Str) is export { use FStrings; do given $inv { "Invoice: {.id}", "Date: {.date}", "Client: {.client}", "", f( 'Description' -f 30, 'Hours' +f 6, 'Rate' +f 8, 'Subtotal' +f 10 ), "-" x 58, |.items.map({ f( .description -f 30, .hours +f 6.1, .rate +f 8.2, .subtotal +f 10.2) }), "-" x 58, f('Subtotal' +f 46, .subtotal +f 10.2), f(.label +f 46, .tax +f 10.2), f( 'Total' +f 46, .total +f 10.2); } .join("\n"); }