private String format(double input)
    {
        // if it i is equal to an int
        if(input == (int) input)
        {
            return String.format("%d", (int) input);
        }
        else if(input > 100)
        {
            //DecimalFormat fmt = new DecimalFormat("###");
            //return fmt.format(input);
            return String.format("%3.0f", input);
        }
        else if(input > 10)
        {
            //DecimalFormat fmt = new DecimalFormat("##.0");
            //String output = fmt.format(input);
            String output = String.format("%3.1f", input);
            if(output.charAt(3) == '0')
            {
                output = output.substring(0, 2);
            }
            return output;
        }
        else
        {
            //DecimalFormat fmt = new DecimalFormat("#.00");
            //String output = fmt.format(input);
            String output = String.format("%3.2f", input);
            if(output.charAt(3) == '0')
            {
                if(output.charAt(2) == '0')
                {
                    output = output.substring(0, 1);
                }
                else
                {
                    output = output.substring(0, 3);
                }
            }
            return output;
        }
    }