-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathtest.pwn
62 lines (53 loc) · 1.46 KB
/
test.pwn
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
#include "humanize.inc"
main() {
// ---
// Thousands Seperator
// ---
new numbers[] = {
10, 100, 1000, 10000, 100000, 1000000, -100000
};
new result[14 + 1];
for(new i = 0; i < sizeof(numbers); i++){
HumanizeThousand(numbers[i], result);
print(result);
}
// You can change the delimiter. By default, the delimiter
// is a comma.
for(new i = 0; i < sizeof(numbers); i++){
HumanizeThousand(numbers[i], result, sizeof(result), ".");
print(result);
}
// ---
// Colors
// ---
new color[32];
HumanizeColor(0xA86420FF, color); // "Chocolate Brown"
print(color);
HumanizeColor(0x42F44EFF, color); // "Lime Green"
print(color);
HumanizeColor(0x137A8EFF, color); // "Teal"
print(color);
// ---
// Ordinals
// ---
new ordinal[32];
for(new i = 0; i < 5; i++)
{
HumanizeOrdinal(i + 1, ordinal);
printf("You got %s place!", ordinal);
}
// ---
// Numbers
// ---
new number[500];
HumanizeNumber(0, number); // "zero"
print(number);
HumanizeNumber(1000, number); // "one thousand"
print(number);
HumanizeNumber(1234, number); // "one thousand two hundred thirty-four"
print(number);
HumanizeNumber(12345, number); // "twelve thousand three hundred forty-five"
print(number);
HumanizeNumber(-12345, number); // "minus twelve thousand three hundred forty-five"
print(number);
}