@@ -68,20 +68,27 @@ default double getPriceShouldBe() {
6868
6969 default void sendErrorMsg (QuickShop plugin , CommandSender sender , String input , String itemName ) {
7070 boolean decFormat = plugin .getConfig ().getBoolean ("use-decimal-format" );
71+ String maxPriceStr ;
72+ String minPriceStr ;
73+ if (decFormat ) {
74+ maxPriceStr = MsgUtil .decimalFormat (getMax ());
75+ minPriceStr = MsgUtil .decimalFormat (getMin ());
76+ } else {
77+ maxPriceStr = Double .toString (getMax ());
78+ minPriceStr = Double .toString (getMin ());
79+ }
7180 switch (getStatus ()) {
7281 case REACHED_PRICE_MIN_LIMIT :
7382 plugin .text ().of (sender , "price-too-cheap" ,
74- (decFormat ) ? MsgUtil .decimalFormat (getMax ())
75- : Double .toString (getMin ())).send ();
83+ minPriceStr ).send ();
7684 case REACHED_PRICE_MAX_LIMIT :
7785 plugin .text ().of (sender , "price-too-high" ,
78- (decFormat ) ? MsgUtil .decimalFormat (getMax ())
79- : Double .toString (getMin ())).send ();
86+ maxPriceStr ).send ();
8087 case PRICE_RESTRICTED :
8188 plugin .text ().of (sender , "restricted-prices" ,
8289 itemName ,
83- String . valueOf ( getMin ()) ,
84- String . valueOf ( getMax ()) ).send ();
90+ minPriceStr ,
91+ maxPriceStr ).send ();
8592 case NOT_VALID :
8693 plugin .text ().of (sender , "not-a-number" , input ).send ();
8794 case NOT_A_WHOLE_NUMBER :
@@ -91,8 +98,8 @@ default void sendErrorMsg(QuickShop plugin, CommandSender sender, String input,
9198 default :
9299 plugin .text ().of (sender , "restricted-prices" ,
93100 itemName ,
94- String . valueOf ( getMin ()) ,
95- String . valueOf ( getMax ()) ).send ();
101+ minPriceStr ,
102+ maxPriceStr ).send ();
96103 }
97104 }
98105}
0 commit comments