This commit is contained in:
Robert Vokac 2024-03-23 08:20:06 +01:00
parent c9692719bb
commit 55afc71d42
No known key found for this signature in database
GPG Key ID: 693D30BEE3329055

View File

@ -16,6 +16,7 @@ import javax.swing.Timer;
import java.awt.Color;
import java.awt.Font;
import java.awt.Graphics;
import java.text.NumberFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.Locale;
@ -84,7 +85,8 @@ public class ProgressMoney extends Widget implements GetProperty {
: Color.LIGHT_GRAY);
brush.setFont(SwingUtils.MEDIUM_MONOSPACE_FONT);
String valueFinal = NumberFormats.FORMATTER_FIVE_DECIMAL_PLACES.format(value) + " " + this.currencyProperty.getValue();
NumberFormat formatter = value >= 10000d ? NumberFormats.FORMATTER_TWO_DECIMAL_PLACES : NumberFormats.FORMATTER_FIVE_DECIMAL_PLACES;
String valueFinal = formatter.format(value) + " " + this.currencyProperty.getValue();
brush.drawString(valueFinal, SwingUtils.MARGIN, SwingUtils.MARGIN + 10);
brush.drawString(typeProperty.getValue(), SwingUtils.MARGIN, SwingUtils.MARGIN + 25);