Converts a Number to a String with Underscores as Decimal Separators. Ignores Numbers with 4 Digits or less.
(long aNumber)
| 1294 | |
| 1295 | /** Converts a Number to a String with Underscores as Decimal Separators. Ignores Numbers with 4 Digits or less. */ |
| 1296 | public static String makeString(long aNumber) { |
| 1297 | if (aNumber > -10000 && aNumber < 10000) return Long.toString(aNumber); |
| 1298 | StringBuilder rString = new StringBuilder(); |
| 1299 | if (aNumber < 0) { |
| 1300 | aNumber *= -1; |
| 1301 | rString.append('-'); |
| 1302 | } |
| 1303 | boolean temp = T; |
| 1304 | for (long i = 1000000000000000000L; i > 0; i /= 10) { |
| 1305 | long tDigit = (aNumber / i) % 10; |
| 1306 | if ( temp && tDigit != 0) temp = F; |
| 1307 | if (!temp) { |
| 1308 | rString.append(tDigit); |
| 1309 | if (i != 1) for (long j = i; j > 0; j /= 1000) if (j == 1) rString.append('_'); |
| 1310 | } |
| 1311 | } |
| 1312 | return rString.toString(); |
| 1313 | } |
| 1314 | |
| 1315 | @SafeVarargs |
| 1316 | public static <E> boolean contains(E aTarget, E... aArray) { |