package io.bisq.gui.components;

import io.bisq.common.util.Tuple2;
import javafx.scene.text.Text;
import javafx.scene.text.TextAlignment;
import javafx.scene.text.TextFlow;

public class ColoredDecimalPlacesWithZerosText extends TextFlow {

    public ColoredDecimalPlacesWithZerosText(String number, int numberOfZerosToColorize) {
        super();

        final String rangeSeparator = " - ";

        if (number.contains(rangeSeparator)) {
            //is range
            String[] splitNumber = number.split(rangeSeparator);
            Tuple2<Text, Text> numbers = getSplittedNumberNodes(splitNumber[0], numberOfZerosToColorize);
            getChildren().addAll(numbers.first, numbers.second);

            getChildren().add(new Text(rangeSeparator));

            numbers = getSplittedNumberNodes(splitNumber[1], numberOfZerosToColorize);
            getChildren().addAll(numbers.first, numbers.second);
        } else {
            Tuple2<Text, Text> numbers = getSplittedNumberNodes(number, numberOfZerosToColorize);
            getChildren().addAll(numbers.first, numbers.second);
        }

        setTextAlignment(TextAlignment.CENTER);
        setPrefHeight(20);

    }

    private Tuple2<Text, Text> getSplittedNumberNodes(String number, int numberOfZeros) {
        String placesBeforeZero = number.split("0{1," + Integer.toString(numberOfZeros) + "}$")[0];
        String zeroDecimalPlaces = number.substring(placesBeforeZero.length());
        Text first = new Text(placesBeforeZero);
        Text last = new Text(zeroDecimalPlaces);
        last.getStyleClass().add("zero-decimals");

        return new Tuple2<>(first, last);
    }
}

@@ -61,16 +61,49 @@
 Tuple2;%0A
+import io.bisq.gui.util.GUIUtil;%0A
 import j
@@ -389,88 +389,51 @@
     
-final String rangeSeparator = %22 - %22;%0A%0A        if (number.contains(rangeSeparator
+if (number.contains(GUIUtil.RANGE_SEPARATOR
 )) %7B
@@ -504,30 +504,39 @@
 r.split(
-rangeSeparator
+GUIUtil.RANGE_SEPARATOR
 );%0A     
@@ -745,22 +745,31 @@
 ext(
-rangeSeparator
+GUIUtil.RANGE_SEPARATOR
 ));%0A

Use GUIUtil.RANGE_SEPARATOR