Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- static void getOutput(int valueInt, out string output)
- {
- double value = valueInt;
- output = "";
- while (value >= 1000)
- {
- output = output == "" ? "k" : output == "k" ? "M" : "G";
- value /= 1000;
- }
- if (value < 1)
- {
- output = "m";
- value *= 1000;
- }
- value = (int)value / 100 > 0 ? Math.Round(value, 1) : (int)value / 10 > 0 ? Math.Round(value, 2) : Math.Round(value, 3);
- output = value.ToString() + output;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement