$max) { return ''; } // The editor always posts 0, 1 or 2; an import or an old page may have nothing. return round($float, (int) $decimals); } /** * The value of the step attribute. It is escaped as a value and put between quotes by render(); escaping a * whole `step="0.01"` turned its quotes into " and made browsers refuse decimals. */ protected function numberStep(string $decimals): string { if ($decimals === '1') { return '0.1'; } if ($decimals === '2') { return '0.01'; } return '1'; } }