Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- List<string> siglas = new List<string>() {
- "K", // Kilo
- "M", // Mega
- "G", // Giga
- "T", // Tera
- "Y" // Yota
- };
- int numero = 10231204124; // ou qualquer outro número
- string resultado;
- while (numero > 1000 && siglas.Count > 0) {
- numero /= 1000;
- resultado = numero.ToString() + siglas[0];
- siglas.RemoveAt(0);
- }
Add Comment
Please, Sign In to add comment