adding millions & thousands localisation (#1132)

* "mil" / "k" localisation adding

* "mil" / "k" localisation adding

* Update bundle.properties

* Update bundle_ru.properties
This commit is contained in:
Felix Corvus 2019-11-26 04:48:53 +03:00 committed by Anuken
parent 01304bf734
commit 2631c4f7af
4 changed files with 8 additions and 4 deletions

View File

@ -591,6 +591,8 @@ unit.persecond = /sec
unit.timesspeed = x speed
unit.percent = %
unit.items = items
unit.thousands = k
unit.millions = mil
category.general = General
category.power = Power
category.liquids = Liquids

View File

@ -589,6 +589,8 @@ unit.persecond = /сек
unit.timesspeed = x скорость
unit.percent = %
unit.items = предметов
unit.thousands = тыс
unit.millions = мил
category.general = Основные
category.power = Энергия
category.liquids = Жидкости

View File

@ -461,11 +461,11 @@ public class UI implements ApplicationListener, Loadable{
public String formatAmount(int number){
if(number >= 1000000){
return Strings.fixed(number / 1000000f, 1) + "[gray]mil[]";
return Strings.fixed(number / 1000000f, 1) + "[gray]" + Core.bundle.getOrNull("unit.millions") + "[]";
}else if(number >= 10000){
return number / 1000 + "[gray]k[]";
}else if(number >= 1000){
return Strings.fixed(number / 1000f, 1) + "[gray]k[]";
return Strings.fixed(number / 1000f, 1) + "[gray]" + Core.bundle.getOrNull("unit.thousands") + "[]";
}else{
return number + "";
}

View File

@ -189,9 +189,9 @@ public class BlockInventoryFragment extends Fragment{
private String round(float f){
f = (int)f;
if(f >= 1000000){
return (int)(f / 1000000f) + "[gray]mil[]";
return (int)(f / 1000000f) + "[gray]" + Core.bundle.getOrNull("unit.millions") + "[]";
}else if(f >= 1000){
return (int)(f / 1000) + "k";
return (int)(f / 1000) + Core.bundle.getOrNull("unit.thousands");
}else{
return (int)f + "";
}