a5df622997ec26eef2fe98e7bc6b013edd327bec.svn-base 686 B

123456789101112131415161718192021222324252627282930
  1. package cn.com.goldenwater.dcproj.util;
  2. public class PtypeConversionUtil {
  3. //补全pType
  4. public static String completion(String pType){
  5. if (pType == null){
  6. return pType;
  7. }
  8. if(pType.length()==1){
  9. return "00"+pType;
  10. }
  11. if (pType.length()==2){
  12. return "0"+pType;
  13. }
  14. return pType;
  15. }
  16. //保留pType数值部分 ,删减首部多余0
  17. public static String deletion(String pType){
  18. if (pType == null || pType == ""){
  19. return pType;
  20. }
  21. int pTypeNum = Integer.parseInt(pType);
  22. pType = String.valueOf(pTypeNum);
  23. return pType;
  24. }
  25. }