mirror of
https://github.com/GTNewHorizons/bdlib.git
synced 2026-11-13 00:37:59 +00:00
Replace NBSP with space in number formatting (for those locales that use it) - minecraft doesn't render NBSP correctly.
This commit is contained in:
1 parent
35def010a3
commit
c44729536c
1 file changed
+6
-6
@@ -16,13 +16,13 @@ object DecFormat {
|
||||
val dec2Fmt = new DecimalFormat("#,##0.00")
|
||||
val dec1Fmt = new DecimalFormat("#,##0.0")
|
||||
|
||||
def round(x: Double) = thousandsFmt.format(x)
|
||||
def round(x: Float) = thousandsFmt.format(x)
|
||||
def round(x: Int) = thousandsFmt.format(x)
|
||||
def round(x: Double) = thousandsFmt.format(x).replace('\u00A0', ' ')
|
||||
def round(x: Float) = thousandsFmt.format(x).replace('\u00A0', ' ')
|
||||
def round(x: Int) = thousandsFmt.format(x).replace('\u00A0', ' ')
|
||||
|
||||
def dec2(x: Double) = dec2Fmt.format(x)
|
||||
def dec2(x: Float) = dec2Fmt.format(x)
|
||||
def dec2(x: Int) = dec2Fmt.format(x)
|
||||
def dec2(x: Double) = dec2Fmt.format(x).replace('\u00A0', ' ')
|
||||
def dec2(x: Float) = dec2Fmt.format(x).replace('\u00A0', ' ')
|
||||
def dec2(x: Int) = dec2Fmt.format(x).replace('\u00A0', ' ')
|
||||
|
||||
def short(x: Double) = if (x > 10) thousandsFmt.format(x) else if (x > 1) dec1Fmt.format(x) else dec2Fmt.format(x)
|
||||
def short(x: Float) = if (x > 10) thousandsFmt.format(x) else if (x > 1) dec1Fmt.format(x) else dec2Fmt.format(x)
|
||||
|
||||
Reference in new issue
Block a user