format infinities (#7009)

* format infinities

* 🤨
This commit is contained in:
router
2022-06-13 05:47:08 +03:00
committed by GitHub
parent 1a63a2726e
commit 1e536622a2

View File

@@ -595,8 +595,9 @@ public class UI implements ApplicationListener, Loadable{
}
public static String formatAmount(long number){
//prevent overflow
if(number == Long.MIN_VALUE) number ++;
//prevent things like bars displaying erroneous representations of casted infinities
if(number == Long.MAX_VALUE) return "";
if(number == Long.MIN_VALUE) return "-∞";
long mag = Math.abs(number);
String sign = number < 0 ? "-" : "";