How to configure Jenkins and CodeCommit to allow users to easily create and destroy infrastructure using Terraform code.
Become a Premium Member and unlock a new, free course in leading technologies each month.
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
public string ConvertNumber(int Number)
{
if (Number >= 1000)
return string.Concat(Number / 1000, "k");
else
return Number.ToString();
}
string GetKNotation(long value)
{
string[] suffix = {"", "K","M", "B", "T"}; // what's after T?
int power = 3;
while (Math.Pow(10, power) < value)
power++;
power--; //was one greater than what we needed
return (value / (long)Math.Pow(10, power)).ToString() + suffix[power/3];
}
string GetKNotation(long value)
{
string[] suffix = {"", "K","M", "B", "T"}; // what's after T?
int power = 1;
while (Math.Pow(10, power) < value)
power++;
power--; //was one greater than what we needed
return (value / (long)Math.Pow(10, power)).ToString() + suffix[power/3];
}
string GetKNotation(long value)
{
string[] suffix = {"", "k","M", "G", "T" , "P", "E", "Z", "Y"}; // what's after Y?
int power = 0;
while (Math.Pow(10, power) < value)
power += 3;
power -= 3; //was one greater than what we needed
return (value / (long)Math.Pow(10, power)).ToString() + suffix[power/3];
}
If you are experiencing a similar issue, please ask a related question
Join the community of 500,000 technology professionals and ask your questions.