Hey mates,
i’m currently making a Clicker Game and want to ask you about ideas for number formattings.
My current solution is this :
private static string FormatCash(double Value)
{
if (Value>= 10000000000000000)
{
return (Value/ 1000000000000000D).ToString("0.#AA");
}
if (Value>= 1000000000000000)
{
return (Value/ 1000000000000000D).ToString("0.##AA");
}
if (Value>= 10000000000000)
{
return (Value/ 1000000000000D).ToString("0.#BB");
}
if (Value>= 1000000000000)
{
return (Value/ 1000000000000D).ToString("0.##BB");
}
if (Value>= 10000000000)
{
return (Value/ 1000000000D).ToString("0.#B");
}
if (Value>= 1000000000)
{
return (Value/ 1000000000D).ToString("0.##B");
}
if (Value>= 100000000)
{
return (Value/ 1000000D).ToString("0.#M");
}
if (Value>= 1000000)
{
return (Value/ 1000000D).ToString("0.##M");
}
if (Value>= 100000)
{
return (Value/ 1000D).ToString("0.#K");
}
if (Value>= 1000)
{
return (Value/ 1000D).ToString("0.##K");
}
return Value.ToString("#,0");
}
But when ill add “huger” number Visual Studio and unity say this : “Integral constant is too large”
Do i have to use Int64 for the huger number formats ?
Another idea was to create small point numbers and let the user think he has billion ore more Score. But how do i do that.
Thanks in advance