';
}
return '';
};
$num = static function ($n, int $d = 0) use ($fmt): string {
return esc($fmt($n, $d));
};
$dash = static function ($v) use ($fmt): string {
if ($v === '' || $v === null) {
return '—';
}
if (is_numeric($v)) {
return esc($fmt($v));
}
return esc((string) $v);
};