aboutsummaryrefslogtreecommitdiff
path: root/ex/numfmt.rip
blob: 903c183dbe49680145ac51ff47fb32328489e8c1 (plain)
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
F<printstr>[D0GW[SodD0G]P]

0I[
	F<numfmt>[
		                       0I[[value]]
		D9i9aGI[               0I[{if value>19}]
			D9iqD3r9ims        0I[[quotient modulus]]
			S                  0I[[modulus quotient]]
			<numfmt>           0I[[modulus "quotient" <quostrlen>]]
			455mm5aD4aS87mi    0I[[modulus "quotient" <quostrlen> 'm' 'i' '9']]
			4R 3a D            0I[[modulus "quotient" 'm' 'i' '9' <quostrlen+3> <quostrlen+3>]]
			5R S               0I[[modulus "quotient" 'i' '9' <quostrlen+3> 'm' <quostrlen+3>]]
			i                  0I[[modulus "quotient" 'i' '9' <quostrlen+3> 'm' <quostrlen+4>]]
			r                  0I[[modulus 'm' "quotient" 'i' '9' <quostrlen+3>]
			                      [modulus 'm' "quotient" 'i' '9' <strlen>]]
			DiiR               0I[['m' "quotient" 'i' '9' <strlen> modulus]]
			D1GI[              0I[{if modulus>1}]
				<numfmt>       0I[['m' "quotient" 'i' '9' <strlen> "modulus" <modstrlen>]]
				DiiR           0I[['m' "quotient" 'i' '9' "modulus" <modstrlen> <strlen>]]
				a              0I[['m' "quotient" 'i' '9' "modulus" <strlen>]]
				99im7a S i     0I[['m' "quotient" 'i' '9' "modulus" 'a' <strlen+1>]]
				D3r i          0I[['m' "quotient" 'i' '9' "modulus" <strlen+1> 'a' <strlen+2>]]
				r              0I[['a' 'm' "quotient" 'i' '9' "modulus" <strlen+1>]
				                  ['a' 'm' "quotient" 'i' '9' "modulus" <strlen>]]
				0d             0I[['a' 'm' "quotient" 'i' '9' "modulus" <strlen> -1]]
			]
			D0GI[              0I[{if modulus>0, so =1}]
				P 9iDm5a S i   0I[['m' "quotient" 'i' '9' 'i' <strlen+1>]]
				Di             0I[['m' "quotient" 'i' '9' 'i' <strlen+1> <strlen+2>]]
				3RS            0I[['m' "quotient" 'i' '9' <strlen+1> 'i' <strlen+2>]]
				r              0I[['i' 'm' "quotient" 'i' '9' <strlen+1>]
				                  ['i' 'm' "quotient" 'i' '9' <strlen>]]
				0d             0I[['i' 'm' "quotient" 'i' '9' <strlen> -1]]
			]
			P0d                0I[["..." <strlen> -1]]
		]
		D9GI[                  0I[{if value>9, so 10..19}]
			455mm5a87mi 2      0I[[value 'i' '9' 2]]
			4R                 0I[['i' '9' 2 value]]
			D92aGI[            0I[{if value>11, so 12..19}]
				SP             0I[['i' '9' value]]
				9is            0I[['i' '9' value-10]]
				68ma           0I[['i' '9' 'value-10']]
				99im7a         0I[['i' '9' 'value-10' 'a']]
				4r 4           0I[['a' 'i' '9' 'value-10' 4]]
				0d             0I[['a' 'i' '9' 'value-10' 4 -1]]
			]
			D9iGI[             0I[{if value>10, so =11}]
				PP             0I[['i' '9']]
				SD3R           0I[['i' 'i' '9']]
				3 0d           0I[['i' 'i' '9' 3 -1]]
			]
			P0d                0I[["..." <strlen> -1]]
		]
		D0dGI[                 0I[{if value>-1, so 0..9}]
			86ma 1             0I[['value' 1]]
			0d                 0I[['value' 1 -1]]
		]
		P
	]
]


F<numfmt>[D9i9aGI[D9iqD3r9imsS<numfmt>455mm5aD4aS87mi4R3aD5RSirDiiRD1GI[<numfmt>DiiRa99im7aSiD3rir0d]D0GI[P9iDm5aSiDi3RSr0d]P0d]D9GI[455mm5a87mi24RD92aGI[SP9is68ma99im7a4r40d]D9iGI[PPSD3R30d]P0d]D0dGI[86ma10d]P]


0
1W[
	DO 84mo D<numfmt><printstr>9io
	i
D9iDm2mL]
P