Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Coinbrawl, Long to String conversion. Display gold with names.
- Input: string
- Output: string
- public static String GoldConverter(string gold)
- {
- var output = "";
- var lengte = gold.Length;
- if (lengte < 6)
- output = gold;
- if (lengte > 6 && lengte <= 9)
- output = (gold.Substring(0, gold.Length - 6) + "," + (gold.Substring(1, gold.Length - 5) + " Million"));
- if (lengte > 9 && lengte <= 12)
- output = (gold.Substring(0, gold.Length - 9) + "," + (gold.Substring(1, gold.Length - 8) + " Billion"));
- if (lengte > 12 && lengte <= 15)
- output = (gold.Substring(0, gold.Length - 12) + "," + (gold.Substring(1, gold.Length - 11) + " Trillion"));
- if (lengte > 15 && lengte <= 18)
- output = (gold.Substring(0, gold.Length - 15) + "," + (gold.Substring(1, gold.Length - 14) + " Quadrillion"));
- if (lengte > 18 && lengte <= 21)
- output = (gold.Substring(0, gold.Length - 18) + "," + (gold.Substring(1, gold.Length - 17) + " Quintillion"));
- return output;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement