Skip to content
Prev 332739 / 398506 Next

convert one digit numbers to two digits one

On Nov 6, 2013, at 10:25 AM, Alaios <alaios at yahoo.com> wrote:

            
This is an example where using ?sprintf gives you more control:
[1] "12:03"
[1] "09:03"


The syntax '%02d' tells sprintf to print the integer and pad with leading zeroes to two characters where needed.

Regards,

Marc Schwartz