Skip to content

Commit

Permalink
improve/simplify Integer>>#gtIntegerFor:
Browse files Browse the repository at this point in the history
  • Loading branch information
svenvc committed Mar 27, 2024
1 parent 7c45df7 commit 6ab3014
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/GToolkit-Extensions/Integer.extension.st
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,15 @@ Integer >> gtIntegerFor: aView [
title: 'Integer';
items: [ | associations |
associations := {
'display' -> self gtDisplayString.
'decimal' -> self printString.
'hex' -> self printStringHex.
'octal' -> (self printStringBase: 8).
'binary' -> (self printStringBase: 2).
'bytes' -> self asStringWithCommas.
'kilobytes' -> (self / 1024) asStringWithCommas.
'megabytes' -> (self / 1048576) asStringWithCommas.
'gigabytes' -> (self / 1073741824) asStringWithCommas.
'bytes' -> self gtDisplayString.
'kilobytes' -> (self / (1024)) floor gtDisplayString.
'megabytes' -> (self / (1024**2)) floor gtDisplayString.
'gigabytes' -> (self / (1024**3)) floor gtDisplayString.
'bytearray' -> self asByteArray.
'bytearray reversed' -> self asByteArray reversed } asOrderedCollection.
(self between: 0 and: 16r10FFFF)
Expand Down

0 comments on commit 6ab3014

Please sign in to comment.