Java Fraction Format formatVersion(float versionNumber)

Here you can find the source of formatVersion(float versionNumber)

Description

Format version number into #0.0 form

License

Open Source License

Parameter

Parameter Description
versionNumber a parameter

Declaration

public static String formatVersion(float versionNumber) 

Method Source Code

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

import java.text.DecimalFormat;

import java.text.NumberFormat;

public class Main {
    /**//from  ww w.ja v a 2  s.co m
     * Format version number into #0.0 form
     * @param versionNumber
     * @return
     */
    public static String formatVersion(float versionNumber) {
        NumberFormat formatter = new DecimalFormat("#0.0");
        return formatter.format(versionNumber);
    }
}

Related

  1. formatted_string(double number)
  2. formatToEightPlaces(double pValue)
  3. formatToString(Double v)
  4. formatTSYS(double tsys)
  5. formatTwoDecimalsToStr(float num)
  6. formatWithOneDecimal(Float value)