diff --git a/deluge/ui/gtkui/createtorrentdialog.py b/deluge/ui/gtkui/createtorrentdialog.py index 7fcc18345..0cd3a534f 100644 --- a/deluge/ui/gtkui/createtorrentdialog.py +++ b/deluge/ui/gtkui/createtorrentdialog.py @@ -115,9 +115,13 @@ class CreateTorrentDialog: def parse_piece_size_text(self, value): psize, metric = value.split() - psize = int(psize) * 1024 - if metric[0] == 'M': - psize *= 1024 + psize = int(psize) + if psize < 32: + # This is a MiB value + psize = psize * 1024 * 1024 + else: + # This is a KiB value + psize = psize * 1024 return psize