private void formatDecimal(BigDecimal dval, FastStringBuffer fsb) {
            dval = dval.setScale(maxFractionPartSize, BigDecimal.ROUND_HALF_EVEN);
            DecimalValue.decimalToString(dval, fsb);

            int point = fsb.indexOf('.');
            int intDigits;
            if (point >= 0) {
                int zz = maxFractionPartSize - minFractionPartSize;
                while (zz>0) {
                    if (fsb.charAt(fsb.length()-1) == '0') {
                        fsb.setLength(fsb.length()-1);
                        zz--;
                    } else {
                        break;
                    }
                }
                intDigits = point;
                if (fsb.charAt(fsb.length()-1) == '.') {
                    fsb.setLength(fsb.length()-1);
                }
            } else {
                intDigits = fsb.length();
                if (minFractionPartSize > 0) {
                    fsb.append('.');
                    for (int i=0; i<minFractionPartSize; i++) {
                        fsb.append('0');
                    }
                }
            }
            if (minWholePartSize == 0 && intDigits == 1 && fsb.charAt(0) == '0') {
                fsb.removeCharAt(0);
            } else {
                fsb.prependRepeated('0', minWholePartSize - intDigits);
            }
        }