145
rated 0 times
[
146]
[
1]
/ answers: 1 / hits: 18260
/ 11 Years ago, tue, march 26, 2013, 12:00:00
I am using the new method: Utilities.formatString()
In the Google Documentation is says it is similar to sprintf %-style.
I searched and read this article about sprintf in PHP.
I cannot seem to get this to work as intended. It is meant to pad this 8 character string with 4 leading zeros. I know there are other ways to do this, But I am trying to get a handle on this sprintf / formatString thing.
var noFormat = 12345678;
var formatted = Utilities.formatString(%012s, noFormat);
I expected the var formatted to be equal to 000012345678.
my debugger tell me that formatted = 0, or sometimes it throws an error..
I am confused.
More From » google-apps-script