# How do I precede a chapter number with 0?

I'm using the memoir class to typeset a novel. I have formatted the chapter display as below. The chapter numbers are displayed as '1', '2', '3', etc. How do I pad the chapter numbers less than 10, using a '0'?

\titleformat
{\chapter}
[display]
{\normalfont\scshape\huge}
{\HUGE\thechapter\centering}
{0pt}
{\vspace{18pt}\centering}[\vspace{42pt}]

• 0\thechapter -- that's all. If you want to achieve this scheme everywhere, better use \renewcommand{\thechapter}{0\arabic{chapter}} – user31729 Jun 10 '16 at 14:44
• Extra question: what should happen at chapter 10? – daleif Jun 10 '16 at 14:47
• @daleif: Well, there's no indication that 0 means padding. Perhaps it's 010, 011 then... – user31729 Jun 10 '16 at 14:50
• @ChristianHupfer thank you for pointing out the ambiguity in the question. I've corrected it now. – Ram Iyer Jun 10 '16 at 14:52

\renewcommand*\thechapter{\ifnum\value{chapter}<10 0\fi\arabic{chapter}}