MCPcopy Index your code
hub / github.com/BruceEckel/OnJava8-Examples / ReceiptBuilder

Method ReceiptBuilder

strings/ReceiptBuilder.java:11–16  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

9 private Formatter f =
10 new Formatter(new StringBuilder());
11 public ReceiptBuilder() {
12 f.format(
13 "%-15s %5s %10s%n", "Item", "Qty", "Price");
14 f.format(
15 "%-15s %5s %10s%n", "----", "---", "-----");
16 }
17 public void add(String name, int qty, double price) {
18 f.format("%-15.15s %5d %10.2f%n", name, qty, price);
19 total += price * qty;

Callers

nothing calls this directly

Calls 1

formatMethod · 0.45

Tested by

no test coverage detected