Package com.google.gwt.i18n.client

Examples of com.google.gwt.i18n.client.NumberFormat.format()


     * @param ms
     * @return
     */
    static String formatDuration(int ms) {
        NumberFormat fmt = NumberFormat.getFormat("00");
        String seconds = fmt.format((ms / 1000) % 60);
        String minutes = fmt.format((ms / (1000 * 60)) % 60);
        String hours = fmt.format((ms / (1000 * 60 * 60)) % 24);

        String millis = NumberFormat.getFormat("000").format(ms % 1000);

View Full Code Here


     * @return
     */
    static String formatDuration(int ms) {
        NumberFormat fmt = NumberFormat.getFormat("00");
        String seconds = fmt.format((ms / 1000) % 60);
        String minutes = fmt.format((ms / (1000 * 60)) % 60);
        String hours = fmt.format((ms / (1000 * 60 * 60)) % 24);

        String millis = NumberFormat.getFormat("000").format(ms % 1000);

        return hours + "h " + minutes + "m " + seconds + "s " + millis + "ms";
View Full Code Here

     */
    static String formatDuration(int ms) {
        NumberFormat fmt = NumberFormat.getFormat("00");
        String seconds = fmt.format((ms / 1000) % 60);
        String minutes = fmt.format((ms / (1000 * 60)) % 60);
        String hours = fmt.format((ms / (1000 * 60 * 60)) % 24);

        String millis = NumberFormat.getFormat("000").format(ms % 1000);

        return hours + "h " + minutes + "m " + seconds + "s " + millis + "ms";
    }
View Full Code Here

    int pageSize = range.getLength();
    int dataSize = display.getRowCount();
    int endIndex = Math.min(dataSize, pageStart + pageSize - 1);
    endIndex = Math.max(pageStart, endIndex);
    boolean exact = display.isRowCountExact();
    return formatter.format(pageStart) + "-" + formatter.format(endIndex)
        + (exact ? " of " : " of over ") + formatter.format(dataSize);
  }

  @Override
  protected void onRangeOrRowCountChanged() {
View Full Code Here

    int pageSize = range.getLength();
    int dataSize = display.getRowCount();
    int endIndex = Math.min(dataSize, pageStart + pageSize - 1);
    endIndex = Math.max(pageStart, endIndex);
    boolean exact = display.isRowCountExact();
    return formatter.format(pageStart) + "-" + formatter.format(endIndex)
        + (exact ? " of " : " of over ") + formatter.format(dataSize);
  }

  @Override
  protected void onRangeOrRowCountChanged() {
View Full Code Here

    int dataSize = display.getRowCount();
    int endIndex = Math.min(dataSize, pageStart + pageSize - 1);
    endIndex = Math.max(pageStart, endIndex);
    boolean exact = display.isRowCountExact();
    return formatter.format(pageStart) + "-" + formatter.format(endIndex)
        + (exact ? " of " : " of over ") + formatter.format(dataSize);
  }

  @Override
  protected void onRangeOrRowCountChanged() {
    HasRows display = getDisplay();
View Full Code Here

        if (dataSize == 0) {
            return "0 of 0";
        } else if (pageStart == endIndex) {
            if (pageStart > dataSize) {
                // This is better than "11 of 10" if the final page is empty
                return "> " + formatter.format(dataSize) + " of " + formatter.format(dataSize);
            } else {
                return formatter.format(pageStart) + " of " + formatter.format(dataSize);
            }
        } else {
            return formatter.format(pageStart) + "-" + formatter.format(endIndex) + (exact ? " of " : " of over ") + formatter.format(dataSize);
View Full Code Here

        if (dataSize == 0) {
            return "0 of 0";
        } else if (pageStart == endIndex) {
            if (pageStart > dataSize) {
                // This is better than "11 of 10" if the final page is empty
                return "> " + formatter.format(dataSize) + " of " + formatter.format(dataSize);
            } else {
                return formatter.format(pageStart) + " of " + formatter.format(dataSize);
            }
        } else {
            return formatter.format(pageStart) + "-" + formatter.format(endIndex) + (exact ? " of " : " of over ") + formatter.format(dataSize);
View Full Code Here

        } else if (pageStart == endIndex) {
            if (pageStart > dataSize) {
                // This is better than "11 of 10" if the final page is empty
                return "> " + formatter.format(dataSize) + " of " + formatter.format(dataSize);
            } else {
                return formatter.format(pageStart) + " of " + formatter.format(dataSize);
            }
        } else {
            return formatter.format(pageStart) + "-" + formatter.format(endIndex) + (exact ? " of " : " of over ") + formatter.format(dataSize);
        }
    }
View Full Code Here

        } else if (pageStart == endIndex) {
            if (pageStart > dataSize) {
                // This is better than "11 of 10" if the final page is empty
                return "> " + formatter.format(dataSize) + " of " + formatter.format(dataSize);
            } else {
                return formatter.format(pageStart) + " of " + formatter.format(dataSize);
            }
        } else {
            return formatter.format(pageStart) + "-" + formatter.format(endIndex) + (exact ? " of " : " of over ") + formatter.format(dataSize);
        }
    }
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.