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

Feature request: Limit irc size announcements to MB #297

Open
hrxcodes opened this issue Jan 2, 2024 · 0 comments
Open

Feature request: Limit irc size announcements to MB #297

hrxcodes opened this issue Jan 2, 2024 · 0 comments

Comments

@hrxcodes
Copy link
Contributor

hrxcodes commented Jan 2, 2024

Limit irc size announcements to MB/MiB

Currently I believe it uses

public static String formatBytes(long bytes, boolean binary) {
long absbytes = Math.abs(bytes);
for (Multiple multiple : MULTIPLES) {
long multipleVal = binary ? multiple.getBinaryMultiple() : multiple
.getMultiple();
if (absbytes >= multipleVal) {
return Bytes.FORMAT.format((float) bytes / multipleVal)
+ multiple.getSuffix() + (binary ? "i" : "") + "B";
}
}
return bytes + "B";
}
for all the formatting. Would be nice if this could stop at M if requested by a config value.

This allows bots to collect size info more reliably keeping to a defined standard unit for announces.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant