Skip to content

Commit 6933973

Browse files
committed
update xferfcn._float2str to be more pythonic per @ilayn
1 parent 5f506b2 commit 6933973

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

control/xferfcn.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,8 @@
7575
}
7676

7777
def _float2str(value):
78-
formatter = "{:" + config.defaults.get('xferfcn.floating_point_format', ':.4g') + "}"
79-
return formatter.format(value)
78+
_num_format = config.defaults.get('xferfcn.floating_point_format', ':.4g')
79+
return f"{value:{_num_format}}"
8080

8181

8282
class TransferFunction(LTI):

0 commit comments

Comments
 (0)