protected static void removeTralingZeros( StringBuilder sb ) {
        int endIndex = sb.length();
        if (endIndex > 0) {
            --endIndex;
            int index = endIndex;
            while (sb.charAt(index) == '0') {
                --index;
            }
            if (index < endIndex) sb.delete(index + 1, endIndex + 1);
        }
    }
protected static void removeTralingZeros ( StringBuilder sb ) { int endIndex = sb . length ( ) ; if ( endIndex > 0 ) { -- endIndex ; int index = endIndex ; while ( sb . charAt ( index ) == '0' ) { -- index ; } if ( index < endIndex ) sb . delete ( index + 1 , endIndex + 1 ) ; } }
Utility to remove the trailing 0's.

@param sb the input string builder; may not be null