-
Notifications
You must be signed in to change notification settings - Fork 370
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
Conversation
Could you please add test? |
@mattn Hi, I add the test, please check :) |
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+)?$`) |
There was a problem hiding this comment.
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*$%$`) |
There was a problem hiding this comment.
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*$%$
Thanks. LGTM. |
From:
|---- 530 | --- 12,960 |
To:
|---- 530 | 12,960 --- |