# Display rules for financial tables and charts: units, missing values, sources, and mobile-friendly statements

Display rules for financial tables and charts: units, rounding, null values, negatives, sources, and CSS that keeps wide financial statements readable on phones.

On a financial data screen, the numbers can be correct and still be misread because of how units or missing values are shown. This page collects the display rules we follow when showing values from the ZENITH Code [income statement endpoint](https://zenithcode.net/en/docs/income-statement) in tables and charts, with code.

- State the unit once in the header. Keep values in yen as the API returns them, and convert only right before display.
- Show missing values (`null`) as "—", never 0, and add the reason when you know it.
- Put the source and retrieval time next to the table. On phones, scroll the table, not the page.

The examples use Toyota Motor (7203) for the fiscal years ended March 2021 through 2025, retrieved from the production API on October 27, 2026 at 16:50 JST.

We at [Crabgrass Inc.](https://crabgrass.co.jp/) build [ZENITH Code](https://zenithcode.net/en), an API for financial and disclosure data on Japanese companies. This article is an implementation guide for using our own data.

## Seven display rules

Here are the rules up front. The sections below explain each one with code.

| Rule | Why |
|---|---|
| Put the unit in the header, not in every cell | Repeating "¥ bn" in every cell makes magnitudes harder to compare |
| Calculate in yen; round only at the end | Calculations on rounded values accumulate error |
| Multiply API ratios by 100 for % | API ratios are decimals from 0 to 1 (0.0998 = 9.98%) |
| Show missing values as "—", never 0 | Writing 0 erases the difference between "no data" and "¥0" |
| Mark negatives with "−", not just color | Readers with color vision deficiency and black-and-white printouts still need to see them |
| Include fiscal period, accounting standard, and consolidation rows | Readers can check in the table whether columns are comparable |
| Put source and retrieval time near the table | Anyone can trace which filing and which moment a number came from |

## Units and rounding

All API amounts are in yen. Toyota's revenue for the fiscal year ended March 2025 is `48036704000000` (¥48.04 trillion). Convert to trillions, billions, or millions only for display.

```javascript
const UNITS = {
  yen: { divisor: 1, label: "¥", digits: 0 },
  million: { divisor: 1e6, label: "¥ million", digits: 0 },
  billion: { divisor: 1e9, label: "¥ billion", digits: 1 },
  trillion: { divisor: 1e12, label: "¥ trillion", digits: 2 },
};

export function formatAmount(value, unit = "billion") {
  if (value === null || value === undefined) return null;
  const { divisor, digits } = UNITS[unit];
  return new Intl.NumberFormat("en-US", {
    minimumFractionDigits: digits,
    maximumFractionDigits: digits,
  }).format(value / divisor).replace("-", "−");
}

export function formatRatio(value, digits = 2) {
  if (value === null || value === undefined) return null;
  return new Intl.NumberFormat("en-US", {
    style: "percent",
    minimumFractionDigits: digits,
    maximumFractionDigits: digits,
  }).format(value).replace("-", "−");
}
```

- Pick one unit per table. Don't mix trillions and billions in the same table.
- Keep decimal places consistent within a column. Without `minimumFractionDigits`, you get `45.1` next to `48.04`.
- Replace the hyphen (-) with a true minus sign (−). It's closer to digit width, so columns line up better.

The same ¥48,036,704,000,000 in different units:

| Unit | Display |
|---|---|
| ¥ trillion (2 decimals) | 48.04 |
| ¥ billion (1 decimal) | 48,036.7 |
| ¥ million (integer) | 48,036,704 |

Large-cap annual figures read well in trillions or billions; small and mid caps in billions or millions. When a table holds several companies, choose a unit that keeps the smallest company's figures meaningful.

## Missing values

When the API returns `null`, put "—" in the table. Never 0. Add a short reason when you know it.

```javascript
const NULL_TEXT = {
  non_jpy_material: "non-yen",
};

export function cellText(row, field, kind, unit) {
  const value = row[field];
  if (value !== null && value !== undefined) {
    return kind === "ratio" ? formatRatio(value) : formatAmount(value, unit);
  }
  const reason = row.nullReason ? ` (${NULL_TEXT[row.nullReason] ?? row.nullReason})` : "";
  return `—${reason}`;
}
```

Common reasons for `null` in the income statement endpoint each mean something different:

| Case | Example | How to show it |
|---|---|---|
| The standard has no such line | Ordinary income (`ordinaryIncome`, a Japanese GAAP subtotal) for IFRS companies. Also `null` in Toyota's sample response | "— (not used under IFRS)" with a note |
| No such line on the statement | `grossProfit` for companies with no gross profit line. Also `null` in Toyota's sample response | "—" |
| Industry-specific format | Companies that report only operating revenue or ordinary revenue (railways, utilities, banks) have `null` `netSales` | Use `revenue` for the top line |
| Not reported in yen | US dollar reporters (6269 and 9399), with `nullReason` of `non_jpy_material` | "— (non-yen)" |
| Not yet available | Pre-listing income statements of newly listed companies | "— (not available)" |

Add one line to the table footnote: "— means no value, not zero." It saves readers from guessing.

## Don't connect lines across missing values

If a line chart skips a missing period and connects the neighbors, it looks as if the missing period had an in-between value. Break the line at gaps.

```javascript
export function segments(points) {
  const out = [];
  let run = [];
  for (const p of points) {
    if (p.value === null || p.value === undefined) {
      if (run.length) out.push(run);
      run = [];
    } else {
      run.push(p);
    }
  }
  if (run.length) out.push(run);
  return out;
}

function linePath(points, x, y) {
  return segments(points)
    .map((run) => run.map((p, i) => `${i ? "L" : "M"}${x(p.period)},${y(p.value)}`).join(""))
    .join("");
}
```

`segments()` splits the series at each missing value. In an SVG `path`, every `M` (move) starts a new line, so the two sides of a gap stay separate.

Bar charts work the same way. Draw no bar for a missing period and put "—" under the axis. A zero-height bar is indistinguishable from ¥0.

A few more chart pitfalls:

- **Don't overlay two vertical axes.** If you show revenue and operating income together, use two stacked panels. Bar heights on different axes can't be compared.
- **Start bar-chart axes at zero.** A truncated axis makes small differences look large. A margin line chart doesn't have to start at zero, but always label the axis.
- **There's nothing between the points.** An annual line connects yearly values; it doesn't represent mid-year values.

## Add period and classification rows to the table

Below the amount rows, add rows for accounting standard and, where relevant, period length and consolidation. Readers can then see in the table whether columns are comparable.

| Item | FY Mar 2021 | FY Mar 2022 | FY Mar 2023 | FY Mar 2024 | FY Mar 2025 |
|---|---:|---:|---:|---:|---:|
| Revenue (¥ trillion) | 27.21 | 31.38 | 37.15 | 45.10 | 48.04 |
| Operating income (¥ trillion) | 2.20 | 3.00 | 2.73 | 5.35 | 4.80 |
| Operating margin | 8.08% | 9.55% | 7.33% | 11.87% | 9.98% |
| Accounting standard | IFRS | IFRS | IFRS | IFRS | IFRS |

*Source: ZENITH Code (processed from TDnet, EDINET, and company disclosures). Retrieved 2026-10-27 16:50 JST. Consolidated, full year. Amounts rounded to two decimals for display only.*

If a period's length (`fiscalPeriodDays`) differs sharply from the others, mark that column with something like "9 months." In a fiscal year-end change, revenue differences can't be explained by performance alone. For comparison rules, see [Calculate year-over-year growth correctly](https://zenithcode.net/en/docs/cookbook/applied/practice-periods-and-yoy).

## Show the source and retrieval time

Right under each table or chart, write:

- **Retrieved**: when you fetched the data from the API, in Japan time, labeled "JST."
- **Scope**: consolidated or standalone, full year or quarter, accounting standard.
- **Filings**: per-period filing IDs where useful. See [Track the source of every financial figure](https://zenithcode.net/en/docs/cookbook/applied/practice-statements-and-sources).

Pages that other people see, such as your own product, have more rules:

- Showing financial data to third parties in your own service requires the Business plan or above. On Free and Pro, you can't make the data, or results derived from it, available to others.
- When you show it, include "Data provided by ZENITH Code (Source: processed from TDnet, EDINET, and company disclosures)."
- Also state that the accuracy of the data isn't guaranteed and that it isn't investment advice.
- Stock prices and values computed from them can't be shown to third parties on any plan. Neither can TDnet filings themselves (PDFs or links to them).

Check [What you can and can't display](https://zenithcode.net/en/docs/display-rights) for details.

## Make financial tables readable on phones

A five-year statement doesn't fit a phone screen, and shrinking the whole table makes it unreadable. Let the table scroll horizontally inside its own box, and pin the row labels to the left.

```html
<figure class="fin">
  <div class="fin-scroll" role="region" aria-labelledby="fin-caption" tabindex="0">
    <table>
      <caption id="fin-caption">Toyota Motor (7203) income statement (¥ trillion)</caption>
      <thead>
        <tr><th scope="col">Item</th><th scope="col">FY Mar 2024</th><th scope="col">FY Mar 2025</th></tr>
      </thead>
      <tbody>
        <tr><th scope="row">Revenue</th><td>45.10</td><td>48.04</td></tr>
        <tr><th scope="row">Operating margin</th><td>11.87%</td><td>9.98%</td></tr>
      </tbody>
    </table>
  </div>
  <figcaption>Source: ZENITH Code / Retrieved 2026-10-27 16:50 JST / — means no value (not zero)</figcaption>
</figure>
```

```css
:root { --fin-bg: #ffffff; --fin-ink: #17263e; --fin-line: #e1e8ef; }
@media (prefers-color-scheme: dark) {
  :root { --fin-bg: #0e131a; --fin-ink: #f1f5fa; --fin-line: #39475a; }
}

.fin-scroll {
  overflow-x: auto;              /* scroll the table, not the page */
  -webkit-overflow-scrolling: touch;
}
.fin table {
  border-collapse: separate;
  border-spacing: 0;
  background: var(--fin-bg);
  color: var(--fin-ink);
  font-variant-numeric: tabular-nums;  /* equal-width digits keep columns aligned */
  white-space: nowrap;                 /* never wrap an amount */
}
.fin td { text-align: right; padding: 8px 12px; border-bottom: 1px solid var(--fin-line); }
.fin th[scope="row"] {
  position: sticky;              /* keep row labels visible while scrolling */
  left: 0;
  background: var(--fin-bg);     /* without a background, scrolled numbers show through */
  text-align: left;
  padding: 8px 12px;
  border-bottom: 1px solid var(--fin-line);
}
.fin caption { text-align: left; font-weight: 600; padding-bottom: 8px; }
```

What each piece does:

- Put `overflow-x: auto` on the wrapping `div`; it has no effect on `table` itself. If the whole page scrolls sideways, other components get pushed off screen too.
- Always give the sticky column a background color, or scrolled numbers show through the labels.
- `font-variant-numeric: tabular-nums` draws every digit at the same width, so stacked amounts line up and are easy to compare.
- `role="region"`, `aria-labelledby`, and `tabindex="0"` let keyboard users scroll the table and let screen readers announce its name.
- Right-align amount columns. Left-aligned numbers of different lengths are hard to compare.

### Oldest first or newest first

On a phone, the first visible column matters most.

- For trend tables, put the oldest period on the left so the table matches the chart. Auto-scroll to the latest period on load so the newest value is visible right away.
- For "check the latest number" tables, put the newest period on the left.

Pick one per screen. A table that runs newest-first next to a chart that runs oldest-first invites misreading.

### Use 16px or larger text in form fields

Safari on iPhone zooms in when you focus an input with text smaller than 16px. Make the ticker input at least 16px on narrow screens.

```css
@media (max-width: 620px) {
  .fin-controls input, .fin-controls select { font-size: 16px; }
}
```

## Redraw charts when the width changes

An SVG chart computes tick and bar positions from the width at draw time. When the screen rotates or the container resizes, redraw at the new width. Scaling the whole chart shrinks the axis labels too.

```javascript
function watchWidth(container, draw) {
  let last = 0;
  const observer = new ResizeObserver(([entry]) => {
    const width = Math.round(entry.contentRect.width);
    if (width === last) return;  // ignore height-only changes
    last = width;
    draw(width);                 // redraw from data in memory; don't call the API again
  });
  observer.observe(container);
  return () => observer.disconnect();
}
```

`ResizeObserver` reacts to changes in the chart's container rather than the window, so it also catches a sidebar opening or closing. Redraw from the data you already have; don't call the API again.

## Read the numbers carefully

- **API ratios are decimals from 0 to 1.** Operating margin is 0.0998 in the API and 9.98% on screen. Forget to multiply and you show 0.10%; multiply twice and you show 998%.
- **Differences between ratios are percentage points.** Going from 11.87% to 9.98% is −1.89 points. Writing "−15.9%" gives a different number (a growth rate).
- **Missing isn't zero.** Ordinary income is `null` for IFRS companies because the standard has no such subtotal. Showing 0 suggests it was ¥0.
- **Use `revenue` for the top line.** `netSales` is the "net sales" line on the statement and is `null` for companies that report only operating revenue or ordinary revenue (railways, utilities, banks). Use `revenue` for a revenue row across companies.
- **Don't calculate from rounded values.** Operating income YoY from the displayed ¥5.35 and ¥4.80 trillion is −10.28%; from raw yen it's −10.41%.
- **Timestamps come back in UTC.** Convert retrieval and disclosure times to Japan time before showing them.

## Summary

- State the unit once. Keep yen values as is and round only for display.
- Show missing values as "—" with a reason when known, and break chart lines at gaps.
- Keep accounting-standard rows, the source, and the retrieval time near the table.
- On phones, scroll the table inside its box with a sticky label column, and redraw charts to fit their container.

## Related

- [Income statement API docs](https://zenithcode.net/en/docs/income-statement)
- [What you can and can't display](https://zenithcode.net/en/docs/display-rights)
- [Accounting standards in Japan (JGAAP, IFRS, US GAAP)](https://zenithcode.net/en/learn/accounting-standards)
- [Calculate year-over-year growth correctly](https://zenithcode.net/en/docs/cookbook/applied/practice-periods-and-yoy)
- [Track the source of every financial figure](https://zenithcode.net/en/docs/cookbook/applied/practice-statements-and-sources)
- [Sample code repository (company-analysis template)](https://github.com/Crab-grass/zenith-code-examples/tree/main/templates/company-analysis)

A Japanese-language walkthrough with screenshots, including theme switching and saved display settings, is on [Qiita](https://qiita.com/Sohei-Taniguchi-CG/items/96b1de81d30de4d9dfa0).

---
Page: https://zenithcode.net/en/docs/cookbook/applied/practice-responsive-layout
日本語: https://zenithcode.net/docs/cookbook/applied/practice-responsive-layout.md
Site guide for AI tools: https://zenithcode.net/llms.txt
