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

Add dicimal numbers to `wp db size` #163

Open
wants to merge 1 commit into
base: master
from
Open

Conversation

@wojsmol
Copy link
Contributor

wojsmol commented Mar 17, 2020

No description provided.

@wojsmol wojsmol requested a review from wp-cli/committers as a code owner Mar 17, 2020
@@ -957,7 +957,7 @@ public function size( $args, $assoc_args ) {
}
$size_format_display = preg_replace( '/IB$/u', 'iB', strtoupper( $size_format ) );

$rows[ $index ]['Size'] = ceil( $row['Size'] / $divisor ) . ' ' . $size_format_display;
$rows[ $index ]['Size'] = round( $row['Size'] / $divisor ) . ' ' . $size_format_display;

This comment has been minimized.

@schlessera

schlessera Mar 17, 2020

Member

I think we should add a flag with the number of digits to round to, and default it to 0. This way, we don't change the current behavior, and people can add their preference to their wp-cli.yml config file.

I think the best name for that flag would be [--decimals=<decimals>].

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.