| Class | Lisp::Format::Directives::Number |
| In: |
lib/facet/lisp-format.rb
|
| Parent: | Directive |
Super-class for number printing directives, namely ~D (Decimal, ~B (Binary), ~O (Octal), and ~X (Hexadecimal). The only difference between these directives is the output radix, which defaults to ten (10), which is decimal.
Create a Number directive, using the given output radix radix.
Output the given argument using its integral representation. The argument must respond to the :to_int message, or else it isn’t considered an integer. This is the normal way in which Ruby operates. The full form is
~mincol,padchar,commachar,commainterval:@[DBOX]
with the following interpretations
An ArgumentError is raised if the argument does not respond to the to_int message.