SHOW:
|
|
- or go back to the newest paste.
1 | - | function formatNumber(inputNumber) |
1 | + | --Get a number in a human-readable format |
2 | - | local number = (inputNumber / 2.5) |
2 | + | --This is used to display numbers on the screen |
3 | - | local round = 0 |
3 | + | |
4 | - | local texts = "" |
4 | + | --@param inputNumber The Number to format |
5 | - | |
5 | + | --@return The formatted number |
6 | - | if number >= 1000000000000000000 then |
6 | + | |
7 | - | round = (number / 1000000000000000000) |
7 | + | ENF = {} |
8 | ||
9 | function ENF.formatNumber(inputNumber) | |
10 | local number = (inputNumber / 2.5) | |
11 | local round = 0 | |
12 | local texts = "" | |
13 | ||
14 | if number >= 1000000000000000000 then | |
15 | round = (number / 1000000000000000000) | |
16 | texts = string.sub(round, 0, 5) .. " EFE" | |
17 | else | |
18 | if number >= 1000000000000000 then | |
19 | round = (number / 1000000000000000) | |
20 | texts = string.sub(round, 0, 5) .. " PFE" | |
21 | else | |
22 | if number >= 1000000000000 then | |
23 | round = (number / 1000000000000) | |
24 | texts = string.sub(round, 0, 5) .. " TFE" | |
25 | else | |
26 | if number >= 1000000000 then | |
27 | round = (number / 1000000000) | |
28 | texts = string.sub(round, 0, 5) .. " GFE" | |
29 | - | else |
29 | + | |
30 | - | texts = string.sub(number, 0, 5) .. " FE" |
30 | + | |
31 | round = (number / 1000000) | |
32 | texts = string.sub(round, 0, 5) .. " MFE" | |
33 | else | |
34 | if number >= 1000 then | |
35 | - | end |
35 | + | |
36 | texts = string.sub(round, 0, 5) .. " kFE" | |
37 | - | |
37 | + | else |
38 | - | return texts |
38 | + | texts = string.sub(number, 0, 5) .. " FE" |
39 | - | end |
39 | + | end |
40 | end | |
41 | end | |
42 | end | |
43 | end | |
44 | end | |
45 | return texts | |
46 | end | |
47 | return ENF |