MCPcopy Create free account
hub / github.com/ReadyTalk/avian / pad

Method pad

classpath/java/text/SimpleDateFormat.java:77–87  ·  view source on GitHub ↗
(StringBuffer buffer, int value, int digits)

Source from the content-addressed store, hash-verified

75 }
76
77 private static void pad(StringBuffer buffer, int value, int digits) {
78 int i = value == 0 ? 1 : value;
79 while (i > 0) {
80 i /= 10;
81 --digits;
82 }
83 while (digits-- > 0) {
84 buffer.append('0');
85 }
86 buffer.append(value);
87 }
88
89 private static int parseField(String text, int offset, int length, Calendar calendar, int field, int adjustment) throws ParseException {
90 if (text.length() < offset + length) throw new ParseException("Short date: " + text, offset);

Callers 1

formatMethod · 0.95

Calls 1

appendMethod · 0.65

Tested by

no test coverage detected