-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathsprintf.js.javascript.txt
25 lines (22 loc) · 1.56 KB
/
sprintf.js.javascript.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
┏━━━━━━━━━━━━━━━━┓
┃ SPRINTF.JS ┃
┗━━━━━━━━━━━━━━━━┛
VERSION ==> #1.0.2
#Browser and Node
SPRINTF.sprintf(STR[, ARG[()]...])#STR can include sequences %[NUM3$][(VARR)][+][PAD'][-][NUM][.NUM2]CHAR
->STR2 # - CHAR:
# - s: STR, of max length NUM2
# - j: OBJ[.VARR]. Padding will be tab size instead. Cannot mix VARR and NUM3.
# - d|i: INT
# - u: UINT
# - b|o|x|X: NUM base 2|8|16 (lowercase|uppercase)
# - f|e: DOUBLE [with scientific notation], decimals truncated at NUM2
# - c: ASCII code
# - %: literal
# - each sequence pick next ARG but can specify by position NUM3 (starts at 1)
# - result will have size min NUM, using padding:
# - right-align or, if "-", left-align
# - with character PAD (def: " "). ' is optional if PAD "0"
# - preceded with "+" if positive NUM and "+" specified
SPRINTF.vsprintf
(STR[, ARG[()]_ARR])->STR2 #