Home
last modified time | relevance | path

Searched refs:fmt (Results 1 – 15 of 15) sorted by relevance

/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/text/
DChoiceFormatTest.java404 ChoiceFormat fmt = new ChoiceFormat( in test_formatL() local
407 assertEquals("NEGATIVE_ONE", fmt.format(Long.MIN_VALUE)); in test_formatL()
408 assertEquals("NEGATIVE_ONE", fmt.format(-1)); in test_formatL()
409 assertEquals("ZERO", fmt.format(0)); in test_formatL()
410 assertEquals("ONE", fmt.format(1)); in test_formatL()
411 assertEquals("GREATER_THAN_ONE", fmt.format(Long.MAX_VALUE)); in test_formatL()
418 ChoiceFormat fmt = new ChoiceFormat( in test_formatD() local
420 assertEquals("NEGATIVE_ONE", fmt.format(Double.NEGATIVE_INFINITY)); in test_formatD()
421 assertEquals("NEGATIVE_ONE", fmt.format(-999999999D)); in test_formatD()
422 assertEquals("NEGATIVE_ONE", fmt.format(-1.1)); in test_formatD()
[all …]
/libcore/luni/src/test/java/libcore/java/util/
DOldFormattableTest.java49 Formatter fmt = new Formatter(); in testFormatTo() local
52 assertTrue(fmt.format("%1.1s", mf).toString().equals("single precision ")); in testFormatTo()
53 assertTrue(fmt.format("%2.1s", mf).toString().equals("single precision single precision ")); in testFormatTo()
54 …assertTrue(fmt.format("%2.2s", mf).toString().equals("single precision single precision double pre… in testFormatTo()
/libcore/ojluni/src/test/java/time/tck/java/time/format/
DTCKDateTimeFormatter.java125 private DateTimeFormatter fmt; field in TCKDateTimeFormatter
129 fmt = new DateTimeFormatterBuilder().appendLiteral("ONE") in setUp()
137 … DateTimeFormatter base = fmt.withLocale(Locale.ENGLISH).withDecimalStyle(DecimalStyle.STANDARD); in test_withLocale()
144 … DateTimeFormatter base = fmt.withLocale(Locale.ENGLISH).withDecimalStyle(DecimalStyle.STANDARD); in test_withLocale_null()
151 DateTimeFormatter test = fmt; in test_withChronology()
162 DateTimeFormatter test = fmt; in test_withZone()
403 … DateTimeFormatter test = fmt.withLocale(Locale.ENGLISH).withDecimalStyle(DecimalStyle.STANDARD); in test_format_TemporalAccessor_simple()
410 … DateTimeFormatter test = fmt.withLocale(Locale.ENGLISH).withDecimalStyle(DecimalStyle.STANDARD); in test_format_TemporalAccessor_noSuchField()
416 … DateTimeFormatter test = fmt.withLocale(Locale.ENGLISH).withDecimalStyle(DecimalStyle.STANDARD); in test_format_TemporalAccessor_null()
423 … DateTimeFormatter test = fmt.withLocale(Locale.ENGLISH).withDecimalStyle(DecimalStyle.STANDARD); in test_print_TemporalAppendable()
[all …]
DTCKDateTimeParseResolver.java1169 DateTimeFormatter fmt = new DateTimeFormatterBuilder() in test_parse_fromField_InstantSeconds() local
1171 TemporalAccessor acc = fmt.parse("86402"); in test_parse_fromField_InstantSeconds()
1186 DateTimeFormatter fmt = new DateTimeFormatterBuilder() in test_parse_fromField_InstantSeconds_NanoOfSecond() local
1188 TemporalAccessor acc = fmt.parse("86402.123456789"); in test_parse_fromField_InstantSeconds_NanoOfSecond()
1204 DateTimeFormatter fmt = new DateTimeFormatterBuilder() in test_parse_fromField_SecondOfDay() local
1206 TemporalAccessor acc = fmt.parse("864"); in test_parse_fromField_SecondOfDay()
1219 DateTimeFormatter fmt = new DateTimeFormatterBuilder() in test_parse_fromField_SecondOfDay_NanoOfSecond() local
1221 TemporalAccessor acc = fmt.parse("864.123456789"); in test_parse_fromField_SecondOfDay_NanoOfSecond()
1235 DateTimeFormatter fmt = new DateTimeFormatterBuilder() in test_parse_fromField_SecondOfMinute() local
1237 TemporalAccessor acc = fmt.parse("32"); in test_parse_fromField_SecondOfMinute()
[all …]
/libcore/ojluni/src/main/java/java/io/
DConsole.java170 public Console format(String fmt, Object ...args) { in format() argument
171 formatter.format(fmt, args).flush(); in format()
244 public String readLine(String fmt, Object ... args) { in readLine() argument
248 if (fmt.length() != 0) in readLine()
249 pw.format(fmt, args); in readLine()
308 public char[] readPassword(String fmt, Object ... args) { in readPassword() argument
319 if (fmt.length() != 0) in readPassword()
320 pw.format(fmt, args); in readPassword()
/libcore/luni/src/test/java/libcore/java/text/
DSimpleDateFormatTest.java180 private static long parseTimeUtc(String fmt, String value) { in parseTimeUtc() argument
181 return parseDateUtc(Locale.ENGLISH, fmt, value).getTime().getTime(); in parseTimeUtc()
200 private String formatDateUtc(Locale l, String fmt) { in formatDateUtc() argument
201 return formatDate(l, fmt, UTC); in formatDateUtc()
204 private String formatDate(Locale l, String fmt, TimeZone tz) { in formatDate() argument
205 DateFormat dateFormat = new SimpleDateFormat(fmt, l); in formatDate()
210 private static void assertCannotParse(Locale l, String fmt, String value) { in assertCannotParse() argument
211 SimpleDateFormat sdf = new SimpleDateFormat(fmt, l); in assertCannotParse()
215 assertNull("Value " + value + " must not parse in locale " + l + " with format " + fmt, d); in assertCannotParse()
223 private static Calendar parseDateUtc(Locale l, String fmt, String value) { in parseDateUtc() argument
[all …]
DDateFormatSymbolsTest.java80 private String formatDate(Locale l, String fmt, DateFormatSymbols dfs) { in formatDate() argument
81 SimpleDateFormat sdf = new SimpleDateFormat(fmt, l); in formatDate()
/libcore/ojluni/src/test/java/time/tck/java/time/
DAbstractTCKTest.java212 Formatter fmt = new Formatter(sb); in dumpSerialStream() local
213 fmt.format(" byte[] bytes = {" ); in dumpSerialStream()
217 fmt.format("%n "); in dumpSerialStream()
219 fmt.format(" %3d,", bytes[i] & 0xff); in dumpSerialStream()
221 fmt.format(" /*"); in dumpSerialStream()
225 fmt.format(" %c", bytes[s + j] & 0xff); in dumpSerialStream()
227 fmt.format(" */"); in dumpSerialStream()
230 fmt.format("%n };%n"); in dumpSerialStream()
/libcore/ojluni/src/test/java/time/test/java/time/format/
DTestZoneTextPrinterParser.java192 DateTimeFormatter fmt = new DateTimeFormatterBuilder().appendZoneText(style, preferred) in test_ParseText() local
196 String ret = fmt.parse(text, TemporalQueries.zone()).getId(); in test_ParseText()
210 DateTimeFormatter fmt = getFormatter(locale, style, ci); in parseText() local
218 parse(fmt, zid, expected, zid, locale, style, ci); in parseText()
221 parse(fmt, zid, expected, names[i], locale, style, ci); in parseText()
226 private void parse(DateTimeFormatter fmt, in parse() argument
232 String ret = fmt.parse(text, TemporalQueries.zone()).getId(); in parse()
DTestDateTimeTextProvider.java184 DateTimeFormatter fmt = getFormatter(field, style).withLocale(locale); in test_getText() local
185 assertEquals(fmt.format(ZonedDateTime.now().with(field, value.longValue())), expected); in test_getText()
/libcore/ojluni/src/main/java/java/text/
DMessageFormat.java530 Format fmt = formats[i]; in toPattern() local
531 if (fmt == null) { in toPattern()
533 } else if (fmt instanceof NumberFormat) { in toPattern()
534 if (fmt.equals(NumberFormat.getInstance(locale))) { in toPattern()
536 } else if (fmt.equals(NumberFormat.getCurrencyInstance(locale))) { in toPattern()
538 } else if (fmt.equals(NumberFormat.getPercentInstance(locale))) { in toPattern()
540 } else if (fmt.equals(NumberFormat.getIntegerInstance(locale))) { in toPattern()
543 if (fmt instanceof DecimalFormat) { in toPattern()
544 result.append(",number,").append(((DecimalFormat)fmt).toPattern()); in toPattern()
545 } else if (fmt instanceof ChoiceFormat) { in toPattern()
[all …]
/libcore/ojluni/src/main/native/
DUnixFileSystem_md.c127 int fmt = mode & S_IFMT; in Java_java_io_UnixFileSystem_getBooleanAttributes0() local
129 | ((fmt == S_IFREG) ? java_io_FileSystem_BA_REGULAR : 0) in Java_java_io_UnixFileSystem_getBooleanAttributes0()
130 | ((fmt == S_IFDIR) ? java_io_FileSystem_BA_DIRECTORY : 0)); in Java_java_io_UnixFileSystem_getBooleanAttributes0()
Djvm.h1269 jio_vsnprintf(char *str, size_t count, const char *fmt, va_list args);
1272 jio_snprintf(char *str, size_t count, const char *fmt, ...);
1275 jio_fprintf(FILE *, const char *fmt, ...);
1278 jio_vfprintf(FILE *, const char *fmt, va_list args);
/libcore/luni/src/main/native/
Dlibcore_icu_ICU.cpp405 …std::unique_ptr<icu::DecimalFormat> fmt(static_cast<icu::DecimalFormat*>(icu::NumberFormat::create… in setNumberPatterns() local
406 pattern = fmt->toPattern(pattern.remove()); in setNumberPatterns()
409fmt.reset(static_cast<icu::DecimalFormat*>(icu::NumberFormat::createInstance(locale, UNUM_DECIMAL,… in setNumberPatterns()
410 pattern = fmt->toPattern(pattern.remove()); in setNumberPatterns()
413fmt.reset(static_cast<icu::DecimalFormat*>(icu::NumberFormat::createInstance(locale, UNUM_PERCENT,… in setNumberPatterns()
414 pattern = fmt->toPattern(pattern.remove()); in setNumberPatterns()
/libcore/ojluni/src/main/java/java/util/
DFormatter.java2967 Formatter fmt = Formatter.this; in printString() local
2968 if (fmt.locale() != l) in printString()
2969 fmt = new Formatter(fmt.out(), l); in printString()
2970 ((Formattable)arg).formatTo(fmt, f.valueOf(), width, precision); in printString()