I'm writing a reporting page which is basically an account statement, and I want to use string_format to pad a balance column but I can't get it to work.
At the minute i've got this:
But what i'd like is:
I've tried using
and following the docs here: http://uk.php.net/sprintf but I can't seem to specify a width...
Also, if it just prints spaces then the browser will ignore all but the first, so how do I get it to print or is there an alternative?
At the minute i've got this:
Code:
CR 245.50
CR 312.00
CR 45.30
CR 5.20
75.50
But what i'd like is:
Code:
CR 245.50
CR 312.00
CR 45.30
CR 5.20
75.50
I've tried using
Code:
{$statement.newBalance|string_format:"CR %.2f"}
and following the docs here: http://uk.php.net/sprintf but I can't seem to specify a width...
Also, if it just prints spaces then the browser will ignore all but the first, so how do I get it to print or is there an alternative?