Java Number Format formatSafetyNumber(String digits)

Here you can find the source of formatSafetyNumber(String digits)

Description

format Safety Number

License

Open Source License

Declaration

public static String formatSafetyNumber(String digits) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    public static String formatSafetyNumber(String digits) {
        final int partCount = 12;
        int partSize = digits.length() / partCount;
        StringBuilder f = new StringBuilder(digits.length() + partCount);
        for (int i = 0; i < partCount; i++) {
            f.append(digits, i * partSize, (i * partSize) + partSize).append(" ");
        }// w w w .j a  va  2 s . c o  m
        return f.toString();
    }
}

Related

  1. formatPhoneNo(String country, String area, String number, String inline)
  2. formatPhoneNumber(String number)
  3. formatPhoneNumber(String phoneNumber)
  4. formatPrintIntegerToString(long number, boolean printCommasP, boolean printSignP, int radix, int mincol, char padchar, char commachar, int commainterval)
  5. formatRowKey(final long number, final int digits, byte[] dest)
  6. formatSheetNumber100(final int sheetNumber)
  7. formatSmallerNumber(String prefix, String suffix, long amnt, boolean useDecimals)
  8. formatTo2Digit(int number)
  9. NumberFormat(double str, int max, int min)