public static String numberToWords(int number) {
        // Zero Rule
        if (number == 0) {
            return smallNumbers[0];
        }

        // Array to hold four three digits group
        int[] digitGroups = new int[4];

        // Ensure the number is positive to extract from
        int positiveNumber = Math.abs(number);

        // Extract the three-digits group
        for (int i = 0; i < digitGroups.length; i++) {
            digitGroups[i] = positiveNumber % 1000;
            positiveNumber /= 1000;
        }

        // Convert each three-digit group to words
        String[] groupText = new String[4];

        for (int i = 0; i < groupText.length; i++) {
            groupText[i] = Main.threeDigitsGroupToWords(digitGroups[i]);
        }

        // Recombine the three digits groups
        String combined = groupText[0];
        boolean appendAnd;

        // Determine whether an 'and' is needed
        appendAnd = (digitGroups[0] > 0) && (digitGroups[0] < 100);

        // Process the remaining groups in turn, smallest to largest
        for (int i = 1; i < groupText.length; i++) {

            if (digitGroups[i] != 0) {
                // Only add non-zero items
                String prefix = groupText[i] + " " + scale[i];

                if (combined.length() != 0) {
                    prefix += appendAnd ? " and " : ", ";
                }

                // Opportunity to add 'and' is ended
                appendAnd = false;

                // And the three-digit group to the combined string
                combined = prefix + combined;
            }
        }

        // Negative Rule
        if (number < 0) {
            combined = "Negative " + combined;
        }

        return combined;
    }