256
edits
Line 89: | Line 89: | ||
notempty(6 > 2); // Returns true | notempty(6 > 2); // Returns true | ||
notempty("", "Not empty", "Empty") // Returns "Empty" | notempty("", "Not empty", "Empty") // Returns "Empty" | ||
==== padding ==== | |||
''string'' '''padding'''(''mixed'' value, ''number'' padding[, ''string'' align]); | |||
Takes value and adds padding on left side if third argument isn't specified. Third argument is optional and may be "left" or "right" and specifies the padding alignment. Second argument specifies the padding width. | |||
'''Example''' | |||
padding("2.40", 6); // Returns " 2.40" | |||
padding("12.40", 6); // Returns " 12.40" | |||
padding("2.40", 6, "left"); // Returns "2.40 " | |||
padding("1220.40", 6); // Returns "1220.40" |
edits