From 71ef35598c6cdf30237fed9813dadb14de49460f Mon Sep 17 00:00:00 2001 From: ChomeNS <95471003+ChomeNS@users.noreply.github.com> Date: Sat, 2 Nov 2024 14:29:02 +0700 Subject: [PATCH] style: use DecimalFormatter on greplog from now on i am going to have the types on commits because why not --- .../java/me/chayapak1/chomens_bot/plugins/GrepLogPlugin.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/java/me/chayapak1/chomens_bot/plugins/GrepLogPlugin.java b/src/main/java/me/chayapak1/chomens_bot/plugins/GrepLogPlugin.java index 1db535c..3bbc8c9 100644 --- a/src/main/java/me/chayapak1/chomens_bot/plugins/GrepLogPlugin.java +++ b/src/main/java/me/chayapak1/chomens_bot/plugins/GrepLogPlugin.java @@ -18,6 +18,7 @@ import java.nio.charset.StandardCharsets; import java.nio.file.Files; import java.nio.file.NotDirectoryException; import java.nio.file.Path; +import java.text.DecimalFormat; import java.util.Arrays; import java.util.Comparator; import java.util.regex.Pattern; @@ -104,10 +105,12 @@ public class GrepLogPlugin { .queue(message -> { final String url = message.getAttachments().get(0).getUrl(); + final DecimalFormat formatter = new DecimalFormat("#,###"); + final Component component = Component.translatable("Found %s matches for %s. You can see the results by clicking %s or in the Discord server.") .color(ColorUtilities.getColorByString(bot.config.colorPalette.defaultColor)) .arguments( - Component.text(matches).color(ColorUtilities.getColorByString(bot.config.colorPalette.number)), + Component.text(formatter.format(matches)).color(ColorUtilities.getColorByString(bot.config.colorPalette.number)), Component.text(input).color(ColorUtilities.getColorByString(bot.config.colorPalette.string)), Component .text("here")