Package org.exist.xquery.util

Examples of org.exist.xquery.util.NumberFormatter.formatNumber()


                final Sequence tz = dt.getTimezone();
                if(tz != Sequence.EMPTY_SEQUENCE) {
                    final DayTimeDurationValue dtv = ((DayTimeDurationValue)tz);
                    final NumberFormatter formatter = NumberFormatter.getInstance(language);
                    sb.append(dtv.getPart(DurationValue.SIGN) >= 0 ? '+' : '-');
                    sb.append(formatter.formatNumber(dtv.getPart(DurationValue.HOUR), "01", 2, 2));
                    sb.append(':');
                    sb.append(formatter.formatNumber(dtv.getPart(DurationValue.MINUTE), "01", 2, 2));
                }
                break;
View Full Code Here


                    final DayTimeDurationValue dtv = ((DayTimeDurationValue)tz);
                    final NumberFormatter formatter = NumberFormatter.getInstance(language);
                    sb.append(dtv.getPart(DurationValue.SIGN) >= 0 ? '+' : '-');
                    sb.append(formatter.formatNumber(dtv.getPart(DurationValue.HOUR), "01", 2, 2));
                    sb.append(':');
                    sb.append(formatter.formatNumber(dtv.getPart(DurationValue.MINUTE), "01", 2, 2));
                }
                break;

            default:
                throw new XPathException(this, ErrorCodes.FOFD1340, "Unrecognized date/time component: " + component);
View Full Code Here

        if (widths != null) {
            if (widths[0] > 0) {min = widths[0];}
            if (widths[1] > 0) {max = widths[1];}
        }
        try {
            sb.append(formatter.formatNumber(num, picture, min, max));
        } catch (final XPathException e) {
            throw new XPathException(this, ErrorCodes.FOFD1350, e.getMessage());
        }
    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.