-
Notifications
You must be signed in to change notification settings - Fork 28
/
Copy pathTextManager.cs
41 lines (40 loc) · 1.07 KB
/
TextManager.cs
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
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace AncientMonkey
{
internal class TextManager
{
public static string ConvertIntToText(long number)
{
string text = "0";
if (number <= 999)
{
text = number.ToString();
}
if (number >= 1000)
{
text = MathF.Round(number / 100) / 10 + "K";
}
if (number >= 100000)
{
text = MathF.Round(number / 1000) + "K";
}
if (number >= 1000000)
{
text = MathF.Round(number / 100000) / 10 + "M";
}
if (number >= 100000000)
{
text = MathF.Round(number / 1000000) + "M";
}
if (number >= 1000000000)
{
text = MathF.Round(number / 100000000) / 10 + "B";
}
return text;
}
}
}