mirror of
https://github.com/beetbox/beets.git
synced 2026-01-07 00:15:20 +01:00
Add a new NullPaddedInt type
This commit is contained in:
parent
bfeb678e41
commit
2acd6772c4
1 changed files with 6 additions and 0 deletions
|
|
@ -143,6 +143,12 @@ class PaddedInt(Integer):
|
|||
return u'{0:0{1}d}'.format(value or 0, self.digits)
|
||||
|
||||
|
||||
class NullPaddedInt(PaddedInt):
|
||||
"""Same as `PaddedInt`, but does not normalize `None` to `0.0`.
|
||||
"""
|
||||
null = None
|
||||
|
||||
|
||||
class ScaledInt(Integer):
|
||||
"""An integer whose formatting operation scales the number by a
|
||||
constant and adds a suffix. Good for units with large magnitudes.
|
||||
|
|
|
|||
Loading…
Reference in a new issue