Jo Morano wrote: > Hi! > > I have a Number that I need to print out along with other strings. I don't > get the leading or trailing 0's and that continues to affect the label whose > text they represent. Is there a C style formatting mechanism which would > make > > string = "" + number > > give me "12.34" when number is 12.34 and "00.00" for number = 0? > > Today I get "12.34" and "0" respectively. >
There is an sprintf implementation in AlivePDF package org.alivepdf.tools. /* sprintf(3) implementation in ActionScript 3.0. * * http://www.die.net/doc/linux/man/man3/sprintf.3.html * * The following flags are supported: '#', '0', '-', '+' * * Field widths are fully supported. '*' is not supported. * * Precision is supported except one difference from the standard: for an * explicit precision of 0 and a result string of "0", the output is "0" * instead of an empty string. * * Length modifiers are not supported. * * The following conversion specifiers are supported: 'd', 'i', 'o', 'u', 'x', * 'X', 'f', 'F', 'c', 's', '%' */ cheers, - shaun

