Java Number Format formatNumber(Integer i, int bisectNumber)

Here you can find the source of formatNumber(Integer i, int bisectNumber)

Description

format Number

License

Open Source License

Declaration

public static Integer[] formatNumber(Integer i, int bisectNumber) 

Method Source Code

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

public class Main {

    public static Integer[] formatNumber(Integer i, int bisectNumber) {

        Integer[] array = new Integer[bisectNumber];
        Double doubleValue = i.doubleValue();
        Double a = doubleValue / bisectNumber;
        Integer intValue = a.intValue();
        for (int index = 0; index < bisectNumber; index++) {
            if (index != (bisectNumber - 1)) {
                array[index] = intValue;
            } else {
                Integer inta = (intValue * bisectNumber);
                Integer aurplus = (i - inta);
                array[index] = (intValue + aurplus);
            }/*from  w  w w .  j a va 2s.  c om*/
        }
        return array;
    }
}

Related

  1. formatNumber(float num, int fragmentSize)
  2. formatNumber(int number)
  3. formatNumber(int number, int zeros)
  4. formatNumber(int theNumber, int theNumberOfDigits)
  5. formatNumber(int value, int width, char c)
  6. FormatNumber(Integer pNumber, int tolLen)
  7. formatNumber(long i, int digits)
  8. formatNumber(long number)
  9. formatNumber(long number, int digits)