private static String addThousandsSeparators(final String number) {
        String integerPart;
        final String decimalPart;

        if (number.contains(".")) {
            final String[] parts = number.split("\\.");
            integerPart = parts[0];
            decimalPart = "." + parts[1];
        } else {
            integerPart = number;
            decimalPart = "";
        }
        final StringBuilder sb = new StringBuilder();

        // GWT so no NumberFormat :-(
        for (int i = 0; i < integerPart.length(); i++) {
            if ((integerPart.length() - i) % 3 == 0) {
                if (sb.length() > 0) {
                    sb.append(",");
                }
            }
            sb.append(integerPart.charAt(i));
        }
        sb.append(decimalPart);
        return sb.toString();
    }
Separates the parts in lowerCamelCase or UpperCamelCase with spaces,
e.g. 'lower Camel Case' and 'Upper Camel Case'.
stroom-util-shared/src/main/java/stroom/util/shared/ModelStringUtil.java