00001 package gov.nasa.arc.ase.util; 00002 00003 public class Right { 00004 public static String format(int value, int digits) { 00005 String result = Integer.toString(value); 00006 00007 while(result.length() < digits) 00008 result = " " + result; 00009 00010 return result; 00011 } 00012 public static String format(String value, int spaces) { 00013 return format(value, spaces, ' '); 00014 } 00015 public static String format(String value, int spaces, char ch) { 00016 while(value.length() < spaces) 00017 value = ch + value; 00018 00019 return value; 00020 } 00021 }