Zero padding in g_strdup_printf



Hi All,

I'm doing a command like this

 *length = g_strdup_printf("%02i:%02.1f", min, seconds);

And if min or seconds is < 10 then I don't get the leading zero like I
would get in a printf. Is this a known bug.

if min is 8 and sec is 5.1 I would expect length to be "08:05.1", but I
seem to be getting "8:5.1" which looks weird.

I'm using gtk 2.12 and glib 2.14

Thanks,

Kevin



-- 
Get my public GnuPG key from
http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x7D0BD5D1



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]