digits

get array of digits of given number


Parameters

digits number :integer

Attributes

base:integeruse given based (default: 10)

Returns

  • :block

Examples

copy
digits 123 ; => [1 2 3] digits 0 ; => [0] digits neg 12345 ; => [1 2 3 4 5] ; digits 1231231231231231231231231231023 ; => [1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 0 2 3]

Related