better ticket count notation

This commit is contained in:
Ellpeck 2020-06-01 15:06:11 +02:00
parent 6a013648f4
commit ee1acca5e8
2 changed files with 15 additions and 3 deletions

View file

@ -94,7 +94,21 @@ namespace ThemeParkClicker {
}
public string DisplayTicketCount() {
return this.Tickets.ToString();
if (this.Tickets < 1000)
return this.Tickets.ToString();
// thousands
if (this.Tickets < 1000000)
return this.Tickets.ToString("0,.##K");
// millions
if (this.Tickets < 1000000000)
return this.Tickets.ToString("0,,.##M");
// billions
if (this.Tickets < 1000000000000)
return this.Tickets.ToString("0,,,.##B");
// trillions
if (this.Tickets < 1000000000000000)
return this.Tickets.ToString("0,,,,.##T");
return this.Tickets.ToString("0,,,,,.##Q");
}
}

View file

@ -24,7 +24,6 @@ namespace ThemeParkClicker {
};
Serializer.Serialize(stream, data);
}
Console.WriteLine("Saved at " + file.FullName);
}
public static bool Load(GameImpl game) {
@ -37,7 +36,6 @@ namespace ThemeParkClicker {
game.LastUpdate = data.LastUpdate;
game.Map = data.Map;
}
Console.WriteLine("Loaded from " + file.FullName);
return true;
}