Skip to content
Snippets Groups Projects
Commit acfc025c authored by John Schihada's avatar John Schihada
Browse files

Made decimals shown with a decimal point instead of a comma

parent 668ccf4c
No related branches found
No related tags found
No related merge requests found
......@@ -92,7 +92,7 @@ public void SpawnLine(LineFact lineFact)
//string letter = ((Char)(64 + lineFact.Id + 1)).ToString();
//line.GetComponentInChildren<TextMeshPro>().text = letter;
line.GetComponentInChildren<TextMeshPro>().text = ((Char)(64 + pointFact1.Id + 1)).ToString() + ((Char)(64 + pointFact2.Id + 1)).ToString();
line.GetComponentInChildren<TextMeshPro>().text += " = " + Math.Round((point1-point2).magnitude, 2).ToString() + " m";
line.GetComponentInChildren<TextMeshPro>().text += " = " + Math.Round((point1-point2).magnitude, 2).ToString().Replace(",", ".") + " m";
line.GetComponentInChildren<FactObject>().Id = lineFact.Id;
//If a new Line was spawned -> We are in CreateLineMode -> Then we want the collider to be disabled
if (CommunicationEvents.ActiveToolMode != ToolMode.ExtraMode)
......@@ -226,7 +226,7 @@ public void SpawnAngle(AngleFact angleFact)
TextMeshPro[] texts = angle.GetComponentsInChildren<TextMeshPro>();
foreach (TextMeshPro t in texts) {
//Change Text not to the id, but to the angle-value (from both sides) AND change font-size relative to length of the angle (from both sides)
t.text = Math.Abs(Math.Round(Vector3.Angle((point1 - point2).normalized, (point3 - point2).normalized), 1)).ToString() + "°";
t.text = Math.Abs(Math.Round(Vector3.Angle((point1 - point2).normalized, (point3 - point2).normalized), 1)).ToString().Replace(",", ".") + "°";
t.fontSize = angle.GetComponentInChildren<TextMeshPro>().fontSize * angle.transform.GetChild(0).transform.GetChild(0).localScale.x;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment