Skip to content

Commit d6df2f3

Browse files
authored
Merge pull request UnityCommunity#51 from a180285/patch-1
Add thousand separators in GetSelectedMeshInfo
2 parents 9c53529 + a6b46fc commit d6df2f3

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

Assets/Scripts/Editor/Tools/GetSelectedMeshInfo.cs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,10 @@ void OnGUI()
6969
}
7070

7171
// display stats
72-
EditorGUILayout.LabelField("Meshes: " + totalMeshes);
73-
EditorGUILayout.LabelField("Vertices: " + totalVertices);
74-
EditorGUILayout.LabelField("Triangles: " + totalTris);
72+
// String.Format("{0:n0}", 9876); // No digits after the decimal point. Output: 9,876
73+
EditorGUILayout.LabelField("Meshes: " + $"{totalMeshes:n0}");
74+
EditorGUILayout.LabelField("Vertices: " + $"{totalVertices:n0}");
75+
EditorGUILayout.LabelField("Triangles: " + $"{totalTris:n0}");
7576
EditorGUILayout.Space();
7677
EditorGUILayout.LabelField("TOP 20", EditorStyles.boldLabel);
7778

@@ -88,7 +89,7 @@ void OnGUI()
8889
{
8990
EditorGUIUtility.PingObject(meshes[item.Key].transform);
9091
}
91-
EditorGUILayout.LabelField(meshes[item.Key].name + " = " + item.Value + " (" + percent + "%)");
92+
EditorGUILayout.LabelField(meshes[item.Key].name + " = " + $"{item.Value:n0}" + " (" + percent + "%)");
9293
GUILayout.ExpandWidth(true);
9394
EditorGUILayout.EndHorizontal();
9495

0 commit comments

Comments
 (0)