diff --git a/dot2tex/utils.py b/dot2tex/utils.py index f4f5e2e..c406fdc 100644 --- a/dot2tex/utils.py +++ b/dot2tex/utils.py @@ -83,6 +83,8 @@ def getboolattr(item, key, default): def smart_float(number): + if isinstance(number, str): + number = number.replace("\\", "").replace("\r", "").replace("\n", ""); number_as_string = "%s" % float(number) if 'e' in number_as_string: return "%.4f" % float(number) @@ -122,4 +124,4 @@ def get_all_graph_elements(graph, l=None): if outer: return l else: - l.append(EndOfGraphElement()) \ No newline at end of file + l.append(EndOfGraphElement())