From d891b586b4506fe4ff7e0ee3013198bf716c5f07 Mon Sep 17 00:00:00 2001 From: Pascal Lais Date: Wed, 11 Mar 2020 18:09:43 +0100 Subject: [PATCH] Update str operator of Point class The coordinates now get rounded to 2 decimals --- point.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/point.py b/point.py index 3536ff3..445e0b5 100644 --- a/point.py +++ b/point.py @@ -29,7 +29,7 @@ class Point(): return self.get_x() != other.get_x() or self.get_y() != other.get_y() def __str__(self): """Returns the coordinates as a string""" - return "(" + str(self.get_x()) + "/" + str(self.get_y()) + ")" + return "(" + str(round(self.get_x(), 2)) + "/" + str(round(self.get_y(), 2)) + ")" def draw(self): """TODO: Draw the point in a canvas"""