Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Let numbers with commas can also be aligned to right #114

Merged
merged 4 commits into from
Oct 26, 2018

Conversation

WakeupTsai
Copy link
Contributor

@WakeupTsai WakeupTsai commented Oct 23, 2018

From:
|---- 530 | --- 12,960 |
To:
|---- 530 | 12,960 --- |

@mattn
Copy link
Collaborator

mattn commented Oct 26, 2018

Could you please add test?

@WakeupTsai
Copy link
Contributor Author

@mattn Hi, I add the test, please check :)

@mattn
Copy link
Collaborator

mattn commented Oct 26, 2018

Thanks.

table.go Outdated
@@ -36,7 +36,7 @@ const (
)

var (
decimal = regexp.MustCompile(`^-*\d*\.?\d*$`)
decimal = regexp.MustCompile(`^(?:\d{1,3}(?:,\d{3})*|\d+)(?:\.\d+)?$`)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

^-?(?:\d{1,3}(?:,\d{3})*|\d+)(?:\.\d+)?$

table.go Outdated
@@ -36,7 +36,7 @@ const (
)

var (
decimal = regexp.MustCompile(`^-*\d*\.?\d*$`)
decimal = regexp.MustCompile(`^(?:\d{1,3}(?:,\d{3})*|\d+)(?:\.\d+)?$`)
percent = regexp.MustCompile(`^-*\d*\.?\d*$%$`)
Copy link
Collaborator

@mattn mattn Oct 26, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please fix this too. ^-?\d+\.?\d*$%$

@mattn
Copy link
Collaborator

mattn commented Oct 26, 2018

Thanks. LGTM.

@mattn mattn merged commit e6d60cf into olekukonko:master Oct 26, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants