Skip to content

Commit

Permalink
Format numbers to use commas in large numbers
Browse files Browse the repository at this point in the history
  • Loading branch information
wfowler1 committed Apr 4, 2024
1 parent c9439ff commit 697f5d7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Assets/Scripts/UI/OptionsMenu.cs
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ public void OnSetDimensionsClicked()
showedWarning = true;
}
},
"This will create " + newCubes + " new cells and bring the total to " + newCellsAmt + ". This may take a while to do and cause poor performance. Continue?",
"This will create " + newCubes.ToString("###,##0") + " new cells and bring the total to " + newCellsAmt.ToString("###,##0") + ". This may take a while to do and cause poor performance. Continue?",
"Yes", "No", null);
}
else
Expand Down
12 changes: 6 additions & 6 deletions Assets/Scripts/UI/UIRoot.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,23 +23,23 @@ public void Update()
{
StringBuilder sb = new StringBuilder();
sb.Append("Dimensions: ")
.Append(gameBehaviour.game.width)
.Append(gameBehaviour.game.width.ToString("###,##0"))
.Append("x")
.Append(gameBehaviour.game.height)
.Append(gameBehaviour.game.height.ToString("###,##0"))
.Append("x")
.Append(gameBehaviour.game.depth)
.Append(gameBehaviour.game.depth.ToString("###,##0"))
.Append("x")
.Append(gameBehaviour.game.colors)
.Append(gameBehaviour.game.colors.ToString("###,##0"))
.Append("\nRules:\n B")
.Append(string.Join(',', gameBehaviour.game.birth))
.Append("\n S")
.Append(string.Join(',', gameBehaviour.game.survival))
.Append("\nWrapping: ")
.Append(gameBehaviour.game.wrap ? "Yes" : "No")
.Append("\nAlive: ")
.Append(gameBehaviour.game.numAlive)
.Append(gameBehaviour.game.numAlive.ToString("###,##0"))
.Append("\nGeneration: ")
.Append(gameBehaviour.game.tickNum)
.Append(gameBehaviour.game.tickNum.ToString("###,##0"))
.Append("\nBehavior: ")
.Append(gameBehaviour.game.currentBehavior);
rulesText.text = sb.ToString();
Expand Down

0 comments on commit 697f5d7

Please sign in to comment.