Here you can find the source of formatNumber(Integer i, int bisectNumber)
public static Integer[] formatNumber(Integer i, int bisectNumber)
//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; } }