Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/geekcomputers/Python
/ truncate_decimals
Method
truncate_decimals
area_of_square_app.py:75–80 ·
view source on GitHub ↗
(self)
Source
from the content-addressed store, hash-verified
73
# return
74
75
def
truncate_decimals(self):
76
return
(
77
f
"{self.area:.10f}"
.rstrip(
"0"
).rstrip(
"."
)
78
if
"."
in str(self.area)
79
else
self.area
80
)
81
82
# Prettifying the output.
83
Callers
3
__init__
Method · 0.95
truncate_decimals_prettify
Method · 0.95
area_of_square_app.py
File · 0.80
Calls
no outgoing calls
Tested by
no test coverage detected