Package java.text

Examples of java.text.DecimalFormat$FastPathData


      progressStr.append(httpToolDocSize / 1024);
      progressStr.append(" kB");
    }

    // ratio
    DecimalFormat myFormat = new DecimalFormat("####0.000");
    progressStr.append(", ");
    progressStr.append(myFormat.format((float)(ratio)/1000));
    progressStr.append(" kB/s");

   
    // time left
    if (this.httpToolDocSize > 0) {
View Full Code Here


  /**
   * update status of dynamic elements
   */
  protected void updateControls() {
    DecimalFormat myFormat = new DecimalFormat("###,###,###.0");
    String retrievedContent=
      robotCount+" files with "
      +myFormat.format((float)robotSize/1024)
      +" kB";
    String queuedContent=robotQueueSize+"";
    retrievedField.setText(retrievedContent);
    queuedField.setText(queuedContent);
  }
View Full Code Here

              NumberFormat currencyFormat;
              if (currency != null) {
                currencyFormat = DecimalFormat.getCurrencyInstance();
                currencyFormat.setCurrency(Currency.getInstance(currency));
              } else {
                currencyFormat = new DecimalFormat("##0.00");
              }
              value = currencyFormat.format(value);
            } else {
              value = "";
            }
View Full Code Here

    Set listkey = itemLines.keySet();
    Iterator it = listkey.iterator();
    String itemExternalID = "";
    int id = 0;
    String fmt = "0.00#";
    DecimalFormat df = new DecimalFormat(fmt, new DecimalFormatSymbols(Locale.US));

    Integer itemID = new Integer(1);

    while (it.hasNext())
    {

      Object obj = it.next();

      itemID = Integer.valueOf(obj.toString());

      ItemElement ele = (ItemElement)itemLines.get(itemID.toString());

      IntMember ItemId = (IntMember)ele.get("ItemId");

      id = Integer.valueOf(ItemId.getDisplayString()).intValue();
      //itemID = (Integer)ItemId.getMemberValue();
      itemExternalID = getEXIDFromID("Item", id);

      StringMember sku = (StringMember)ele.get("SKU");

      FloatMember qty = (FloatMember)ele.get("Quantity");

      FloatMember priceEach = (FloatMember)ele.get("PriceEach");

      FloatMember priceExe = (FloatMember)ele.get("PriceExtended");

      qbTags += "<" + tagName + "> \n" + "<ItemRef> \n" + "<ListID>" + itemExternalID + "</ListID> \n" + "</ItemRef> \n" + "<Quantity>" + df.format(Float.valueOf(qty.getMemberValue().toString())) + "</Quantity> \n" + "<Rate>" + df.format(Float.valueOf(priceEach.getMemberValue().toString())) + "</Rate> \n" + "<Amount>"
          + df.format(Float.valueOf(priceExe.getMemberValue().toString())) + "</Amount> \n" + "</" + tagName + "> \n";
    }
    return qbTags;
  }
View Full Code Here

  public String getDisplayString()
  {
    if(auth == ModuleFieldRightMatrix.NONE_RIGHT)
      return "";
   
    DecimalFormat currencyFormat = new DecimalFormat("###,###,##0.00");
    String returnString = currencyFormat.format(memberValue);
    return returnString;
  } //end of getDisplayString method
View Full Code Here

        if(offset >= 0) {
          description.append("+");
        }
        description.append(hour);
        description.append(":");
        DecimalFormat df = new DecimalFormat("00");
        description.append(df.format(min));
        description.append(")");
        if (!descriptionList.contains(description)) {
          timeZoneColl.add(new DDNameValue(zoneIds[i], description.toString()));
          descriptionList.add(description);
        }
View Full Code Here

      }
      case FieldDecoration.fileSizeType:
        // display the string to file Size
        // which in byte to GB,MB,KB
        float size = (new Float(content.toString())).floatValue();
        DecimalFormat df = new DecimalFormat("###.#");
        Integer s = new Integer((int) size);
        valueString = s.toString();
        if (size > 1000000000) {
          size /= 1073741824; // 1GB
          valueString = df.format(size) + "GB";
        } else if (size > 1000000) {
          size /= 1048576; // 1MB
          valueString = df.format(size) + "MB";
        } else if (size > 1000) {
          size /= 1024; // 1KB
          valueString = df.format(size) + "KB";
        }
        decoratedField.append(valueString);
        break;

      case FieldDecoration.moneyType:
View Full Code Here

        swarm_completion = DisplayFormatters.formatPercentFromThousands( comp );
      }
     
      piecesDoneAndSum = pm.getPiecePicker().getNbPiecesDone() + "/" + piecesDoneAndSum;
     
      distributedCopies = new DecimalFormat("0.000").format(pm.getPiecePicker().getMinAvailability()-pm.getNbSeeds()-(pm.isSeeding()&&stats.getDownloadCompleted(false)==1000?1:0));
    }
   
   

    setStats(
View Full Code Here

        }
        return buf.toString();
    }

    public static String formatNumber(final long number) {
        DecimalFormat f = new DecimalFormat("#,###");
        return f.format(number);
    }
View Full Code Here

    public static String formatNumber(final double number) {
        return formatNumber(number, true);
    }

    public static String formatNumber(final double number, boolean commaSep) {
        DecimalFormat f = new DecimalFormat(commaSep ? "#,###.###" : "###.###");
        f.setDecimalSeparatorAlwaysShown(false);
        return f.format(number);
    }
View Full Code Here

TOP

Related Classes of java.text.DecimalFormat$FastPathData

Copyright © 2018 www.massapicom. 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.