Skip to content

Commit

Permalink
float fixes again
Browse files Browse the repository at this point in the history
  • Loading branch information
jquast committed Mar 24, 2014
1 parent 00c47d5 commit 71380dc
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions blessed/sequences.py
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ def rjust(self, width, fillchar=u' '):
Returns string derived from unicode string ``S``, right-adjusted
by leading whitespace padding ``fillchar``."""
leftside = fillchar * int((max(0, float(width - self.length())))
leftside = fillchar * int((max(0.0, float(width - self.length())))
/ float(len(fillchar)))
return u''.join((leftside, self))

Expand All @@ -374,9 +374,9 @@ def center(self, width, fillchar=u' '):
Returns string derived from unicode string ``S``, centered
and surrounded with whitespace padding ``fillchar``."""
split = max(0.0, float(width) - self.length()) / 2
leftside = fillchar * int((max(0,0, math.floor(split)))
leftside = fillchar * int((max(0.0, math.floor(split)))
/ float(len(fillchar)))
rightside = fillchar * int((max(0,0, math.ceil(split)))
rightside = fillchar * int((max(0.0, math.ceil(split)))
/ float(len(fillchar)))
return u''.join((leftside, self, rightside))

Expand Down

0 comments on commit 71380dc

Please sign in to comment.