MCPcopy Create free account
hub / github.com/MenoData/Time4J / createNumber

Method createNumber

base/src/main/java/net/time4j/MachineTime.java:1198–1216  ·  view source on GitHub ↗
(StringBuilder sb)

Source from the content-addressed store, hash-verified

1196 }
1197
1198 private void createNumber(StringBuilder sb) {
1199
1200 if (this.isNegative()) {
1201 sb.append('-');
1202 sb.append(Math.abs(this.seconds));
1203 } else {
1204 sb.append(this.seconds);
1205 }
1206
1207 if (this.nanos != 0) {
1208 sb.append('.');
1209 String fraction = String.valueOf(Math.abs(this.nanos));
1210 for (int i = 9 - fraction.length(); i > 0; i--) {
1211 sb.append('0');
1212 }
1213 sb.append(fraction);
1214 }
1215
1216 }
1217
1218 @SuppressWarnings("unchecked")
1219 private static <T> T cast(Object obj) {

Callers 2

toStringMethod · 0.95
toBigDecimalMethod · 0.95

Calls 4

isNegativeMethod · 0.95
absMethod · 0.45
valueOfMethod · 0.45
lengthMethod · 0.45

Tested by

no test coverage detected