Skip to main content

num: digits, a forced sign, a prefix or suffix

AFC, 2024
TeamNet EPA/playPoints for
KC+0.063385 pts
LAC+0.101402 pts
DEN+0.108425 pts
LV−0.146309 pts
BUF+0.190525 pts
MIA−0.019345 pts
NYJ−0.045338 pts
NE289 pts
import { STANDINGS, type Standing } from "@sportsdataverse/examples/data";
import { defineTable } from "@sportsdataverse/sdvtables";
import { renderHTMLAsync } from "@sportsdataverse/sdvtables/html";

// New England has no net EPA on file (null): the cell stays blank.
const spec = defineTable<Standing>()
.columns((c) => [
c.text("team"),
c.num("net_epa", { label: "Net EPA/play", digits: 3, forceSign: true }),
c.num("pf", { label: "Points for", digits: 0, suffix: " pts" }),
])
.title("AFC, 2024")
.build();
await renderHTMLAsync(spec, STANDINGS);

Tags: kind · num. All sdvtables examples.