org.opentripplanner.common.LoggingUtil Maven / Gradle / Ivy
package org.opentripplanner.common;
/**
* Utility functions for logging output.
*/
public class LoggingUtil {
public static String human (int n) {
if (n >= 1000000000) return String.format("%.1fG", n/1000000000.0);
if (n >= 1000000) return String.format("%.1fM", n/1000000.0);
if (n >= 1000) return String.format("%dk", n/1000);
else return String.format("%d", n);
}
}