Package java.text

Examples of java.text.Format.format()


        int outmon = output.get(Calendar.MONTH);
        int inyear = input.get(Calendar.YEAR);
        int indom = input.get(Calendar.DAY_OF_MONTH);
        int inmon = input.get(Calendar.MONTH);
        if (indom != outdom || inmon != outmon || inyear != outyear){
            fail("Test: '"+msg+"' Server="+longFormat.format(now.getTime())
                    +". Failed to parse "+shortDate
                    +". Actual "+longFormat.format(output.getTime())
                    +". Expected "+longFormat.format(input.getTime()));
        }
    }
View Full Code Here


        int indom = input.get(Calendar.DAY_OF_MONTH);
        int inmon = input.get(Calendar.MONTH);
        if (indom != outdom || inmon != outmon || inyear != outyear){
            fail("Test: '"+msg+"' Server="+longFormat.format(now.getTime())
                    +". Failed to parse "+shortDate
                    +". Actual "+longFormat.format(output.getTime())
                    +". Expected "+longFormat.format(input.getTime()));
        }
    }

    public void testParseShortPastDates1() throws Exception {
View Full Code Here

        int inmon = input.get(Calendar.MONTH);
        if (indom != outdom || inmon != outmon || inyear != outyear){
            fail("Test: '"+msg+"' Server="+longFormat.format(now.getTime())
                    +". Failed to parse "+shortDate
                    +". Actual "+longFormat.format(output.getTime())
                    +". Expected "+longFormat.format(input.getTime()));
        }
    }

    public void testParseShortPastDates1() throws Exception {
        GregorianCalendar now = new GregorianCalendar(2001, Calendar.MAY, 30, 12, 0);
View Full Code Here

    if (numberAsString.indexOf("E") != -1
        || numberAsString.indexOf("e") != -1) {
      Format format = new DecimalFormat(UNROUNDED_DECIMAL_PATTERN);

      try {
        return format.format(new Double(numberAsString));
      } catch (NumberFormatException numberFormatException) {
        return NOT_A_NUMBER_PREFIX + " (" + numberAsString + ")";
      }
    }
    return numberAsString;
View Full Code Here

      return cachedResult;
    }

    try
    {
      cachedResult = f.format(o);
    }
    catch (IllegalArgumentException e)
    {
      cachedResult = getNullValue();
    }
View Full Code Here

        // should return the Date according to the provided format

        if (SynapseConstants.SYSTEM_DATE.equals(key)) {
            if (dateformat != null) {
                Format formatter = new SimpleDateFormat(dateformat.toString());
                return formatter.format(new java.util.Date());
            } else {
                Format formatter = new SimpleDateFormat();
                return formatter.format(new java.util.Date());
            }
        }
View Full Code Here

            if (dateformat != null) {
                Format formatter = new SimpleDateFormat(dateformat.toString());
                return formatter.format(new java.util.Date());
            } else {
                Format formatter = new SimpleDateFormat();
                return formatter.format(new java.util.Date());
            }
        }

        //return the current system time as a string , don't care scope
        if (SynapseConstants.SYSTEM_TIME.equals(key)) {
View Full Code Here

      return EMPTY_STRING;
    if (defaultValue != null && hideZeroValues && defaultValue.equals(value))
      return EMPTY_STRING;
    Format f = getFormat(object);
    if (f != null) {
      return f.format(value);
    } else {
      if (isHyperlink())
        return ((Hyperlink)value).toString();
      return FieldConverter.toString(value, getDisplayType(), null); // Convert
                                      // to
View Full Code Here

        }
        if(param instanceof Float){
          srcParam += numberFormat.format(param);
        }
        if(param instanceof Date){
          srcParam += formatter.format(param);
        }
      } else{
        srcParam += "null";
      }
      srcParam += Constants.SEPRATE;
View Full Code Here

        }
        if(param instanceof Float){
          srcParam += numberFormat.format(param);
        }
        if(param instanceof Date){
          srcParam += formatter.format(param);
        }
      } else{
        srcParam += "null";
      }
      srcParam += Constants.SEPRATE;
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.