183
rated 0 times
[
184]
[
1]
/ answers: 1 / hits: 24851
/ 13 Years ago, fri, april 15, 2011, 12:00:00
I need a JavaScript function (or jQuery plugin) for printf
/sprintf
. It needs to support named arguments (%(foo)s
) and padding (%02d
), i.e. the following format string should work:
%(amount)s.%(subunits)02d
It only needs to support s
and d
, I don't care about all the other format strings (e.g. f
, x
, etc.). I don't need padding for strings/s
, just d
, I only need simple padding for d
, e.g. %2d
, %3d
, %04d
, etc.
More From » jquery