Skip to content

Missing $pad_type in Colors::pad() (str_pad) #121

Closed

Description

@urlund

Trying to align numbers to the right in a cli table, but STR_PAD_LEFT seems to be missing.

Current ASCII table creates:

+----+------+---------+
| ID | Name | Balance |
+----+------+---------+
| 3  | Foo  | 10,00   |
| 10 | Bar  | 1200,00 |
+----+------+---------+
|    |      | 1210,00 |
+----+------+---------+

What I want is:

+----+------+---------+
| ID | Name | Balance |
+----+------+---------+
|  3 | Foo  |   10,00 |
| 10 | Bar  | 1200,00 |
+----+------+---------+
|    |      | 1210,00 |
+----+------+---------+

But Colors::pad() while extending ACSII table padColum does not have the possibility to provide STR_PAD_RIGHT or STR_PAD_LEFT based on the $column number.

Fixed in PR: #120

Activity

  1. changed the title [-]Missing $pad_type in str_pad [/-] [+]Missing $pad_type in Colors::pad() (str_pad)[/+] on Oct 2, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions