Michael Thomas Flanagan's Java Scientific Library

Conv Class:      Inter-conversion of Data Types and of Physical Units

     

Last update of this class: 13 June 2014                                                                                                                             PERMISSION TO COPY
Main Page of Michael Thomas Flanagan's Java Scientific Library

This class contains methods for: See ArrayMaths for methods for recasting the type of one dimensional arrays, e.g. int[] to double[], double[] to Complex[].
See DataType for methods for recasting the elements of ArrayList, ArrayDeque, LinkedList, Object[] and Vector.

The deep copy methods may now be found in the DeepCopy class. Those that were part of this Conv class have be retained for compatibility purposes but will no longer be listed in this documentation.

import directive: import flanagan.math.Conv;

SUMMARY OF METHODS

'Possible loss of
precision' messages
suppress messages public static void suppressMessages()
restore messages public static void restoreMessages()
Conversion
of double
double to Double public static Double convert_double_to_Double(double xx)
double to float public static float convert_double_to_float(double xx)
double to Float public static Float convert_double_to_Float(double xx)
double to long public static long convert_double_to_long(double xx)
double to Long public static Long convert_double_to_Long(double xx)
double to int public static int convert_double_to_int(double xx)
double to Integer public static Integer convert_double_to_Integer(double xx)
double to short public static short convert_double_to_short(double xx)
double to Short public static Short convert_double_to_Short(double xx)
double to byte public static byte convert_double_to_byte(double xx)
double to Byte public static Byte convert_double_to_Byte(double xx)
double to BigDecimal public static BigDecimal convert_double_to_BigDecimal(double xx)
double to BigInteger public static BigIntegral convert_double_to_BigIntegral(double xx)
double to String public static String convert_double_to_String(double xx)
Conversion
of Double
Double to double public static double convert_Double_to_double(Double xx)
Double to float public static float convert_Double_to_float(Double xx)
Double to Float public static Float convert_Double_to_Float(Double xx)
Double to long public static long convert_Double_to_long(Double xx)
Double to Long public static Long convert_Double_to_Long(Double xx)
Double to int public static int convert_Double_to_int(Double xx)
Double to Integer public static Integer convert_Double_to_Integer(Double xx)
Double to short public static short convert_Double_to_short(Double xx)
Double to Short public static Short convert_Double_to_Short(Double xx)
Double to byte public static byte convert_Double_to_byte(Double xx)
Double to Byte public static Byte convert_Double_to_Byte(Double xx)
Double to BigDecimal public static BigDecimal convert_Double_to_BigDecimal(Double xx)
Double to BigInteger public static BigIntegral convert_Double_to_BigIntegral(Double xx)
Double to String public static String convert_Double_to_String(Double xx)
Conversion
of float
float to double public static double convert_float_to_double(float xx)
float to Double public static Double convert_float_to_Double(float xx)
float to Float public static Float convert_float_to_Float(float xx)
float to long public static long convert_float_to_long(float xx)
float to Long public static Long convert_float_to_Long(float xx)
float to int public static int convert_float_to_int(float xx)
float to Integer public static Integer convert_float_to_Integer(float xx)
float to short public static short convert_float_to_short(float xx)
float to Short public static Short convert_float_to_Short(float xx)
float to byte public static byte convert_float_to_byte(float xx)
float to Byte public static Byte convert_float_to_Byte(float xx)
float to BigDecimal public static BigDecimal convert_float_to_BigDecimal(float xx)
float to BigInteger public static BigIntegral convert_float_to_BigIntegral(float xx)
float to String public static String convert_float_to_String(float xx)
Conversion
of Float
Float to double public static double convert_Float_to_double(Float xx)
Float to Double public static Double convert_Float_to_Double(Float xx)
Float to float public static float convert_Float_to_float(Float xx)
Float to long public static long convert_Float_to_long(Float xx)
Float to Long public static Long convert_Float_to_Long(Float xx)
Float to int public static int convert_Float_to_int(Float xx)
Float to Integer public static Integer convert_Float_to_Integer(Float xx)
Float to short public static short convert_Float_to_short(Float xx)
Float to Short public static Short convert_Float_to_Short(Float xx)
Float to byte public static byte convert_Float_to_byte(Float xx)
Float to Byte public static Byte convert_Float_to_Byte(Float xx)
Float to BigDecimal public static BigDecimal convert_Float_to_BigDecimal(Float xx)
Float to BigInteger public static BigIntegral convert_Float_to_BigIntegral(Float xx)
Float to String public static String convert_Float_to_String(Float xx)
Conversion
of long
long to double public static double convert_long_to_double(long xx)
long to Double public static Double convert_long_to_Double(long xx)
long to float public static float convert_long_to_float(long xx)
long to Float public static Float convert_long_to_Float(long xx)
long to Long public static Long convert_long_to_Long(long xx)
long to int public static int convert_long_to_int(long xx)
long to Integer public static Integer convert_long_to_Integer(long xx)
long to short public static short convert_long_to_short(long xx)
long to Short public static Short convert_long_to_Short(long xx)
long to byte public static byte convert_long_to_byte(long xx)
long to Byte public static Byte convert_long_to_Byte(long xx)
long to BigDecimal public static BigDecimal convert_long_to_BigDecimal(long xx)
long to BigInteger public static BigIntegral convert_long_to_BigIntegral(long xx)
long to String public static String convert_long_to_String(long xx)
Conversion
of Long
Long to double public static double convert_Long_to_double(Long xx)
Long to Double public static Double convert_Long_to_Double(Long xx)
Long to float public static float convert_Long_to_float(Long xx)
Long to Float public static Float convert_Long_to_Float(Long xx)
Long to long public static long convert_Long_to_long(Long xx)
Long to int public static int convert_Long_to_int(Long xx)
Long to Integer public static Integer convert_Long_to_Integer(Long xx)
Long to short public static short convert_Long_to_short(Long xx)
Long to Short public static Short convert_Long_to_Short(Long xx)
Long to byte public static byte convert_Long_to_byte(Long xx)
Long to Byte public static Byte convert_Long_to_Byte(Long xx)
Long to BigDecimal public static BigDecimal convert_Long_to_BigDecimal(Long xx)
Long to BigInteger public static BigIntegral convert_Long_to_BigIntegral(long xx)
Long to String public static String convert_Long_to_String(Long xx)
Conversion
of int
int to double public static double convert_int_to_double(int xx)
int to Double public static Double convert_int_to_Double(int xx)
int to float public static float convert_int_to_float(int xx)
int to Float public static Float convert_int_to_Float(int xx)
int to long public static long convert_int_to_long(int xx)
int to Long public static Long convert_int_to_Long(int xx)
int to Integer public static Integer convert_int_to_Integer(int xx)
int to short public static short convert_int_to_short(int xx)
int to Short public static Short convert_int_to_Short(int xx)
int to byte public static byte convert_int_to_byte(int xx)
int to Byte public static Byte convert_int_to_Byte(int xx)
int to BigDecimal public static BigDecimal convert_int_to_BigDecimal(int xx)
int to BigInteger public static BigIntegral convert_int_to_BigIntegral(int xx)
int to String public static String convert_int_to_String(int xx)
int to char public static char convert_int_to_char(int xx)
Conversion
of Integer
Integer to double public static double convert_Integer_to_double(Integer xx)
Integer to Double public static Double convert_Integer_to_Double(Integer xx)
Integer to float public static float convert_Integer_to_float(Integer xx)
Integer to Float public static Float convert_Integer_to_Float(Integer xx)
Integer to long public static long convert_Integer_to_long(Integer xx)
Integer to Long public static Long convert_Integer_to_Long(Integer xx)
Integer to int public static int convert_Integer_to_int(Integer xx)
Integer to short public static short convert_Integer_to_short(Integer xx)
Integer to Short public static Short convert_Integer_to_Short(Integer xx)
Integer to byte public static byte convert_Integer_to_byte(Integer xx)
Integer to Byte public static Byte convert_Integer_to_Byte(Integer xx)
Integer to BigDecimal public static BigDecimal convert_Integer_to_BigDecimal(Integer xx)
Integer to BigInteger public static BigIntegral convert_Integer_to_BigIntegral(Integer xx)
Integer to String public static String convert_Integer_to_String(Integer xx)
Conversion
of short
short to double public static double convert_short_to_double(short xx)
short to Double public static Double convert_short_to_Double(short xx)
short to float public static float convert_short_to_float(short xx)
short to Float public static Float convert_short_to_Float(short xx)
short to long public static long convert_short_to_long(short xx)
short to Long public static Long convert_short_to_Long(short xx)
short to int public static int convert_short_to_int(short xx)
short to Integer public static Integer convert_short_to_Integer(short xx)
short to Short public static Short convert_short_to_Short(short xx)
short to byte public static byte convert_short_to_byte(short xx)
short to Byte public static Byte convert_short_to_Byte(short xx)
short to BigDecimal public static BigDecimal convert_short_to_BigDecimal(short xx)
short to BigInteger public static BigIntegral convert_short_to_BigIntegral(short xx)
short to String public static String convert_short_to_String(short xx)
Conversion
of Short
Short to double public static double convert_Short_to_double(Short xx)
Short to Double public static Double convert_Short_to_Double(Short xx)
Short to float public static float convert_Short_to_float(Short xx)
Short to Float public static Float convert_Short_to_Float(Short xx)
Short to long public static long convert_Short_to_long(Short xx)
Short to Long public static Long convert_Short_to_Long(Short xx)
Short to int public static int convert_Short_to_int(Short xx)
Short to Integer public static Integer convert_Short_to_Integer(Short xx)
Short to short public static short convert_Short_to_short(Short xx)
Short to byte public static byte convert_Short_to_byte(Short xx)
Short to Byte public static Byte convert_Short_to_Byte(Short xx)
Short to BigDecimal public static BigDecimal convert_Short_to_BigDecimal(Short xx)
Short to BigInteger public static BigIntegral convert_Short_to_BigIntegral(Short xx)
Short to String public static String convert_Short_to_String(Short xx)
Conversion
of byte
byte to double public static double convert_byte_to_double(byte xx)
byte to Double public static Double convert_byte_to_Double(byte xx)
byte to float public static float convert_byte_to_float(byte xx)
byte to Float public static Float convert_byte_to_Float(byte xx)
byte to long public static long convert_byte_to_long(byte xx)
byte to Long public static Long convert_byte_to_Long(byte xx)
byte to int public static int convert_byte_to_int(byte xx)
byte to Integer public static Integer convert_byte_to_Integer(byte xx)
byte to short public static short convert_byte_to_short(byte xx)
byte to Short public static Short convert_byte_to_Short(byte xx)
byte to Byte public static Byte convert_byte_to_Byte(byte xx)
byte to BigDecimal public static BigDecimal convert_byte_to_BigDecimal(byte xx)
byte to BigInteger public static BigIntegral convert_byte_to_BigIntegral(byte xx)
byte to String public static String convert_byte_to_String(byte xx)
Conversion
of Byte
Byte to double public static double convert_Byte_to_double(Byte xx)
Byte to Double public static Double convert_Byte_to_Double(Byte xx)
Byte to float public static float convert_Byte_to_float(Byte xx)
Byte to Float public static Float convert_Byte_to_Float(Byte xx)
Byte to long public static long convert_Byte_to_long(Byte xx)
Byte to Long public static Long convert_Byte_to_Long(Byte xx)
Byte to int public static int convert_Byte_to_int(Byte xx)
Byte to Integer public static Integer convert_Byte_to_Integer(Byte xx)
Byte to short public static short convert_Byte_to_short(Byte xx)
Byte to Short public static Short convert_Byte_to_Short(Byte xx)
Byte to byte public static byte convert_Byte_to_byte(Byte xx)
Byte to BigDecimal public static BigDecimal convert_Byte_to_BigDecimal(Byte xx)
Byte to BigInteger public static BigIntegral convert_Byte_to_BigIntegral(Byte xx)
Byte to String public static String convert_Byte_to_String(Byte xx)
Conversion
of BigDecimal
BigDecimal to double public static double convert_BigDecimal_to_double(BigDecimal xx)
BigDecimal to Double public static Double convert_BigDecimal_to_Double(BigDecimal xx)
BigDecimal to float public static float convert_BigDecimal_to_float(BigDecimal xx)
BigDecimal to Float public static Float convert_BigDecimal_to_Float(BigDecimal xx)
BigDecimal to long public static long convert_BigDecimal_to_long(BigDecimal xx)
BigDecimal to Long public static Long convert_BigDecimal_to_Long(BigDecimal xx)
BigDecimal to int public static int convert_BigDecimal_to_int(BigDecimal xx)
BigDecimal to Integer public static Integer convert_BigDecimal_to_Integer(BigDecimal xx)
BigDecimal to short public static short convert_BigDecimal_to_short(BigDecimal xx)
BigDecimal to Short public static Short convert_BigDecimal_to_Short(BigDecimal xx)
BigDecimal to byte public static byte convert_BigDecimal_to_byte(BigDecimal xx)
BigDecimal to Byte public static Byte convert_BigDecimal_to_Byte(BigDecimal xx)
BigDecimal to BigInteger public static BigIntegral convert_BigDecimal_to_BigIntegral(BigDecimal xx)
BigDecimal to String public static String convert_BigDecimal_to_String(BigDecimal xx)
Conversion
of BigInteger
BigInteger to double public static double convert_BigInteger_to_double(BigInteger xx)
BigInteger to Double public static Double convert_BigInteger_to_Double(BigInteger xx)
BigInteger to float public static float convert_BigInteger_to_float(BigInteger xx)
BigInteger to Float public static Float convert_BigInteger_to_Float(BigInteger xx)
BigInteger to long public static long convert_BigInteger_to_long(BigInteger xx)
BigInteger to Long public static Long convert_BigInteger_to_Long(BigInteger xx)
BigInteger to int public static int convert_BigInteger_to_int(BigInteger xx)
BigInteger to Integer public static Integer convert_BigInteger_to_Integer(BigInteger xx)
BigInteger to short public static short convert_BigInteger_to_short(BigInteger xx)
BigInteger to Short public static Short convert_BigInteger_to_Short(BigInteger xx)
BigInteger to byte public static byte convert_BigInteger_to_byte(BigInteger xx)
BigInteger to Byte public static Byte convert_BigInteger_to_Byte(BigInteger xx)
BigInteger to BigDecimal public static BigIntegral convert_BigInteger_to_BigDecimal(BigInteger xx)
BigInteger to String public static String convert_BigInteger_to_String(BigInteger xx)
Conversion
of String
String to double public static double convert_String_to_double(String xx)
String to Double public static Double convert_String_to_Double(String xx)
String to float public static float convert_String_to_float(String xx)
String to Float public static Float convert_String_to_Float(String xx)
String to long public static long convert_String_to_long(String xx)
String to Long public static Long convert_String_to_Long(String xx)
String to int public static int convert_String_to_int(String xx)
String to Integer public static Integer convert_String_to_Integer(String xx)
String to short public static short convert_String_to_short(String xx)
String to Short public static Short convert_String_to_Short(String xx)
String to byte public static byte convert_String_to_byte(String xx)
String to Byte public static Byte convert_String_to_Byte(String xx)
String to BigDecimal public static BigDecimal convert_String_to_BigDecimal(String xx)
String to BigInteger public static BigInteger convert_String_to_BigInteger(String xx)
String to Title Case public static String toTitleCase(String xx)
Conversion
of char
char to double public static double convert_char_to_double(char xx)
char to Double public static Double convert_char_to_Double(char xx)
char to float public static float convert_char_to_float(char xx)
char to Float public static Float convert_char_to_Float(char xx)
char to long public static long convert_char_to_long(char xx)
char to Long public static Long convert_char_to_Long(char xx)
char to int public static int convert_char_to_int(char xx)
char to Integer public static Integer convert_char_to_Integer(char xx)
char to short public static short convert_char_to_short(char xx)
char to Short public static Short convert_char_to_Short(char xx)
char to byte public static byte convert_char_to_byte(char xx)
char to Byte public static Byte convert_char_to_Byte(char xx)
char to BigDecimal public static BigIntegral convert_char_to_BigDecimal(char xx)
char to BigInteger public static char convert_char_to_BigInteger(char xx)
char to String public static char convert_char_to_String(char xx)
Conversion
of Character
Character to double public static double convert_Character_to_double(Character xx)
Character to Double public static Double convert_Character_to_Double(Character xx)
Character to float public static float convert_Character_to_float(Character xx)
Character to Float public static Float convert_Character_to_Float(Character xx)
Character to long public static long convert_Character_to_long(Character xx)
Character to Long public static Long convert_Character_to_Long(Character xx)
Character to int public static int convert_Character_to_int(Character xx)
Character to Integer public static Integer convert_Character_to_Integer(Character xx)
Character to short public static short convert_Character_to_short(Character xx)
Character to Short public static Short convert_Character_to_Short(Character xx)
Character to byte public static byte convert_Character_to_byte(Character xx)
Character to Byte public static Byte convert_Character_to_Byte(Character xx)
Character to BigDecimal public static BigIntegral convert_Character_to_BigDecimal(Character xx)
Character to BigInteger public static Character convert_Character_to_BigInteger(Character xx)
Character to String public static Character convert_Character_to_String(Character xx)
Complex and Phasor Complex to Phasor public static Phasor convert_Complex_to_Phasor(Complex xx)
Complex to String public static String convert_Complex_to_String(Complex xx)
Phasor to Complex public static Complex convert_Phasor_to_Complex(Phasor xx)
Phasor to String public static String convert_Phasor_to_String(Phasor xx)
Decimal, Hexadecimal and Binary Decimal to Hexadecimal public static String decToHex()
public static String decToHex(long xx)
public static String decToHex(int xx)
Decimal to Binary public static String decToBin()
public static String decToBin(long xx)
public static String decToBin(int xx)
Hexadecimal to Decimal public static long hexToDec()
public static long hexToDec(String xx)
Hexadecimal to Binary public static String hexToBin()
public static String hexToBin(String xx)
Binary to Decimal public static long binToDec()
public static long binToDec(String xx)
Binary to Hexadecimal public static String binToHex()
public static StringbinToHex(String xx)
Conversion
of physical units
Degrees to radians public static double degToRad(double deg)
Radians to degrees public static double radToDeg(double rad)
Frequency (Hz)
to radial frequency
public static double frequencyToRadialFrequency(double frequency)
Radial frequency
to frequency (Hz)
public static double radialFrequencyToFrequency(double radial)
Electron volts
to wavelength in nanometres
public static double evToNm(double ev)
Wavelength in nanometres to
Electron volts
public static double nmToEv(double nm)
Molar to %w/v public static double molarToPercentWeightByVol(double molar, double molWeight)
%w/v to molar public static double percentWeightByVolToMolar(double percent, double molWeight)
Date and time to milliseconds
since 0 hours 0 minutes 0 seconds
on 1 Jan 1970 (computer time)
public static long dateToJavaMilliSecondsUK(int year, int month, int day, String dayOfTheWeek, int hour, int min, int sec, int millisec)
Height and weight to
body mass index (BMI) [metric]
public static double calcBMImetric(double height, double weight)
Height and weight to
body mass index (BMI) [imperial]
public static double calcBMIimperial(double height, double weight)
BMI and height to
weight [metric]
public static double calcWeightFromBMImetric(double bmi, double height)
BMI and height to
weight [imperial]
public static double calcWeightFromBMIimperial(double bmi, double height)
Celsius to Kelvin public static double celsiusToKelvin(double cels)
Kelvin to Celsius public static double kelvinToCelsius(double kelv)
Celsius to Fahrenheit public static double celsiusToFahren(double cels)
Fahrenheit to Celsius public static double fahrenToCelsius(double fahr)
Calories to Joules public static double calorieToJoule(double cal)
Joules to Calories public static double jouleToCalorie(double joule)
Ounces to grams public static double ounceToGram(double oz)
Grams to ounces public static double gramToOunce(double gm)
Pounds to kilograms public static double poundToKg(double pd)
Kilograms to pounds public static double kgToPound(double kg)
UK tons to kilograms public static double tonToKg(double ton)
Kilograms to UK tons public static double kgToTon(double kg)
Inches to millimetres public static double inchToMillimetre(double in)
Millimetres to inches public static double millimetreToInch(double mm)
Feet to metres public static double footToMetre(double ft)
Metres to feet public static double metreToFoot(double metre)
Yards to metres public static double yardToMetre(double yd)
Metres to yards public static double metreToYard(double metre)
Miles to kilometres public static double mileToKm(double mile)
Kilometres to miles public static double kmToMile(double km)
UK gallons to litres public static double gallonToLitre(double gall)
Litres to UK gallons public static double litreToGallon(double litre)
UK quarts to litres public static double quartToLitre(double quart)
Litres to UK quarts public static double litreToQuart(double litre)
UK pints to litres public static double pintToLitre(double pint)
Litres to UK pints public static double litreToPint(double litre)
UK gallons per mile to
litres per kilometre
public static double gallonPerMileToLitrePerKm(double gallPmile)
Litres per kilometre to
UK gallons per mile
public static double litrePerKmToGallonPerMile(double litrePkm)
Miles per UK gallon to
kilometres per litre
public static double milePergallonToKmPerLitre(double milePgall)
Kilometres per litre to
miles per UK gallon
public static double kmPerLitreToMilePerGallon(double kmPlitre)
UK fluid ounce to American fluid ounce public static double fluidOunceUKtoUS(double flozUK)
American fluid ounce to UK fluid ounce public static double fluidOunceUStoUK(double flozUK)
UK pint to American liquid pint public static double pintUKtoUS(double pintUK)
American liquid pint to UK pint public static double pintUStoUK(double pintUK)
UK quart to American liquid quart public static double quartUKtoUS(double quartUK)
American liquid quart to UK quart public static double quartUStoUK(double quartUK)
UK gallon to American gallon public static double gallonUKtoUS(double gallonUK)
American gallon to UK gallon public static double gallonUStoUK(double gallonUS)
UK pint to American cup public static double pintUKtoCupUS(double pintUK)
American cup to UK pint public static double cupUStoPintUK(double cupUS)




CONVERSION OF DATA TYPES

These methods support the inter-conversion (recasting) the following data types:   double,   Double,   float,   Float,   long,   Long,   int,   Integer,   short,   Short,   byte,   Byte,   BigDecimal,   BigInteger,   Complex   or   Phasor.
See ArrayMaths for interconversions of one dimensional arrays of the above listed data types.

Suppression of possible loss of precision messages
public static void suppressMessages()
Usage:                      Conv.suppressMessages();
Calling this method suppresses the displaying on screen of the 'possible loss of precision' messages that are normally displayed before a conversion in which such a loss may occur.

Restoration of 'possible loss of precision' messages
public static void restoreMessages()
Usage:                      Conv.restoreMessages();
Calling this method restores the displaying on screen of the 'possible loss of precision' messages that are normally displayed before a conversion in which such a loss may occur. This method need only be called if the suppressMessages() method (immediately above) has previously been called and restoration is required. The default option of this class is to display such messages.

Conversion of double
public static Double convert_double_to_Double(double xx)
public static float convert_double_to_float(double xx)
public static Float convert_double_to_Float(double xx)
public static long convert_double_to_long(double xx)
public static Long convert_double_to_Long(double xx)
public static int convert_double_to_int(double xx)
public static Integer convert_double_to_Integer(double xx)
public static short convert_double_to_short(double xx)
public static Short convert_double_to_Short(double xx)
public static byte convert_double_to_byte(double xx)
public static Byte convert_double_to_Byte(double xx)
public static BigDecimal convert_double_to_BigDecimal(double xx)
public static BigIntegral convert_double_to_BigIntegral(double xx)
public static String convert_double_to_String(double xx)

General usage:                      bb = Conv.convert_double_to_xxxx(aa);
where xxxx may be Double, float, Float, long, Long, int, Integer, short, Short, byte, Byte, BigDecimal, BigInteger or String. The double variable aa is converted to the type matching xxxx, i.e. Double, float, Float, long, Long, int, Integer, short, Short, byte, Byte, BigDecimal, BigInteger or String, which is returned to bb

Conversion of Double
public static double convert_Double_to_double(Double xx)
public static float convert_Double_to_float(Double xx)
public static Float convert_Double_to_Float(Double xx)
public static long convert_Double_to_long(Double xx)
public static Long convert_Double_to_Long(Double xx)
public static int convert_Double_to_int(Double xx)
public static Integer convert_Double_to_Integer(Double xx)
public static short convert_Double_to_short(Double xx)
public static Short convert_Double_to_Short(Double xx)
public static byte convert_Double_to_byte(Double xx)
public static Byte convert_Double_to_Byte(Double xx)
public static BigDecimal convert_Double_to_BigDecimal(Double xx)
public static BigIntegral convert_Double_to_BigIntegral(Double xx)
public static String convert_Double_to_String(Double xx)

General usage:                      bb = Conv.convert_Double_to_xxxx(aa);
where xxxx may be double, float, Float, long, Long, int, Integer, short, Short, byte, Byte, BigDecimal, BigInteger or String. The Double variable aa is converted to the type matching xxxx, i.e. double, float, Float, long, Long, int, Integer, short, Short, byte, Byte, BigDecimal, BigInteger or String, which is returned to bb

Conversion of float
public static double convert_float_to_double(float xx)
public static Double convert_float_to_Double(float xx)
public static Float convert_float_to_Float(float xx)
public static long convert_float_to_long(float xx)
public static Long convert_float_to_Long(float xx)
public static int convert_float_to_int(float xx)
public static Integer convert_float_to_Integer(float xx)
public static short convert_float_to_short(float xx)
public static Short convert_float_to_Short(float xx)
public static byte convert_float_to_byte(float xx)
public static Byte convert_float_to_Byte(float xx)
public static BigDecimal convert_float_to_BigDecimal(float xx)
public static BigIntegral convert_float_to_BigIntegral(float xx)
public static String convert_float_to_String(float xx)

General usage:                      bb = Conv.convert_float_to_xxxx(aa);
where xxxx may be double, Double, Float, long, Long, int, Integer, short, Short, byte, Byte, BigDecimal, BigInteger or String. The float variable aa is converted to the type matching xxxx, i.e. double, Double, Float, long, Long, int, Integer, short, Short, byte, Byte, BigDecimal, BigInteger or String, which is returned to bb

Conversion of Float
public static double convert_Float_to_double(Float xx)
public static Double convert_Float_to_Double(Float xx)
public static float convert_Float_to_float(Float xx)
public static long convert_Float_to_long(Float xx)
public static Long convert_Float_to_Long(Float xx)
public static int convert_Float_to_int(Float xx)
public static Integer convert_Float_to_Integer(Float xx)
public static short convert_Float_to_short(Float xx)
public static Short convert_Float_to_Short(Float xx)
public static byte convert_Float_to_byte(Float xx)
public static Byte convert_Float_to_Byte(Float xx)
public static BigDecimal convert_Float_to_BigDecimal(Float xx)
public static BigIntegral convert_Float_to_BigIntegral(Float xx)
public static String convert_Float_to_String(Float xx)

General usage:                      bb = Conv.convert_Float_to_xxxx(aa);
where xxxx may be double, Double, float, long, Long, int, Integer, short, Short, byte, Byte, BigDecimal, BigInteger or String. The Float variable aa is converted to the type matching xxxx, i.e. double, Double, float, long, Long, int, Integer, short, Short, byte, Byte, BigDecimal, BigInteger or String, which is returned to bb

Conversion of long
public static double convert_long_to_double(long xx)
public static Double convert_long_to_Double(long xx)
public static float convert_long_to_float(long xx)
public static Float convert_long_to_Float(long xx)
public static Long convert_long_to_Long(long xx)
public static int convert_long_to_int(long xx)
public static Integer convert_long_to_Integer(long xx)
public static short convert_long_to_short(long xx)
public static Short convert_long_to_Short(long xx)
public static byte convert_long_to_byte(long xx)
public static Byte convert_long_to_Byte(long xx)
public static BigDecimal convert_long_to_BigDecimal(long xx)
public static BigIntegral convert_long_to_BigIntegral(long xx)
public static String convert_long_to_String(long xx)

General usage:                      bb = Conv.convert_long_to_xxxx(aa);
where xxxx may be double, Double, float, Float, Long int, Integer, short, Short, byte, Byte, BigDecimal, BigInteger or String. The long variable aa is converted to the type matching xxxx, i.e. double, Double, float, Float, Long, int, Integer, short, Short, byte, Byte, BigDecimal, BigInteger or String, which is returned to bb

Conversion of Long
public static double convert_Long_to_double(Long xx)
public static Double convert_Long_to_Double(Long xx)
public static float convert_Long_to_float(Long xx)
public static Float convert_Long_to_Float(Long xx)
public static long convert_Long_to_long(Long xx)
public static int convert_Long_to_int(Long xx)
public static Integer convert_Long_to_Integer(Long xx)
public static short convert_Long_to_short(Long xx)
public static Short convert_Long_to_Short(Long xx)
public static byte convert_Long_to_byte(Long xx)
public static Byte convert_Long_to_Byte(Long xx)
public static BigDecimal convert_Long_to_BigDecimal(Long xx)
public static BigIntegral convert_Long_to_BigIntegral(Long xx)
public static String convert_Long_to_String(Long xx)

General usage:                      bb = Conv.convert_Long_to_xxxx(aa);
where xxxx may be double, Double, float, Float, long, int, Integer, short, Short, byte, Byte, BigDecimal, BigInteger or String. The Long variable aa is converted to the type matching xxxx, i.e. double, Double, float, Float, int, Integer, long, short, Short, byte, Byte, BigDecimal, BigInteger or String, which is returned to bb

Conversion of int
public static double convert_int_to_double(int xx)
public static Double convert_int_to_Double(int xx)
public static float convert_int_to_float(int xx)
public static Float convert_int_to_Float(int xx)
public static long convert_int_to_long(int xx)
public static Long convert_int_to_Long(int xx)
public static Integer convert_int_to_Integer(int xx)
public static short convert_int_to_short(int xx)
public static Short convert_int_to_Short(int xx)
public static byte convert_int_to_byte(int xx)
public static Byte convert_int_to_Byte(int xx)
public static BigDecimal convert_int_to_BigDecimal(int xx)
public static BigIntegral convert_int_to_BigIntegral(int xx)
public static String convert_int_to_String(int xx)
public static char convert_int_to_char(int xx)

General usage:                      bb = Conv.convert_int_to_xxxx(aa);
where xxxx may be double, Double, float, Float, long, Long, , short, Short, byte, Byte, BigDecimal, BigInteger, String or char. The int variable aa is converted to the type matching xxxx, i.e. double, Double, float, Float, long, Long, Integer, short, Short, byte, Byte, BigDecimal, BigInteger, String or char, which is returned to bb

Conversion of Integer
public static double convert_Integer_to_double(Integer xx)
public static Double convert_Integer_to_Double(Integer xx)
public static float convert_Integer_to_float(Integer xx)
public static Float convert_Integer_to_Float(Integer xx)
public static long convert_Integer_to_long(Integer xx)
public static Long convert_Integer_to_Long(Integer xx)
public static int convert_Integer_to_int(Integer xx)
public static short convert_Integer_to_short(Integer xx)
public static Short convert_Integer_to_Short(Integer xx)
public static byte convert_Integer_to_byte(Integer xx)
public static Byte convert_Integer_to_Byte(Integer xx)
public static BigDecimal convert_Integer_to_BigDecimal(Integer xx)
public static BigIntegral convert_Integer_to_BigIntegral(Integer xx)

General usage:                      bb = Conv.convert_Integer_to_xxxx(aa);
where xxxx may be double, Double, float, Float, long, Long, int, short, Short, byte, Byte, BigDecimal, BigInteger or String. The Integer variable aa is converted to the type matching xxxx, i.e. double, Double, float, Float, long, Long, int, short, Short, byte, Byte, BigDecimal, BigInteger or String, which is returned to bb

Conversion of short
public static double convert_short_to_double(short xx)
public static Double convert_short_to_Double(short xx)
public static float convert_short_to_float(short xx)
public static Float convert_short_to_Float(short xx)
public static long convert_short_to_long(short xx)
public static Long convert_short_to_Long(short xx)
public static int convert_short_to_int(short xx)
public static Integer convert_short_to_Integer(short xx)
public static Short convert_short_to_Short(short xx)
public static byte convert_short_to_byte(short xx)
public static Byte convert_short_to_Byte(short xx)
public static BigDecimal convert_short_to_BigDecimal(short xx)
public static BigIntegral convert_short_to_BigIntegral(short xx)

General usage:                      bb = Conv.convert_short_to_xxxx(aa);
where xxxx may be double, Double, float, Float, long, Long, int, Integer, short byte, Byte, BigDecimal, BigInteger or String. The short variable aa is converted to the type matching xxxx, i.e. double, Double, float, Float, long, Long, int, Integer, Short, byte, Byte, BigDecimal, BigInteger or String, which is returned to bb

Conversion of Short
public static double convert_Short_to_double(Short xx)
public static Double convert_Short_to_Double(Short xx)
public static float convert_Short_to_float(Short xx)
public static Float convert_Short_to_Float(Short xx)
public static long convert_Short_to_long(Short xx)
public static Long convert_Short_to_Long(Short xx)
public static int convert_Short_to_int(Short xx)
public static Integer convert_Short_to_Integer(Short xx)
public static Short convert_short_to_Short(short xx)
public static byte convert_Short_to_byte(Short xx)
public static Byte convert_Short_to_Byte(Short xx)
public static BigDecimal convert_Short_to_BigDecimal(Short xx)
public static BigIntegral convert_Short_to_BigIntegral(Short xx)

General usage:                      bb = Conv.convert_Short_to_xxxx(aa);
where xxxx may be double, Double, float, Float, long, Long, int, Integer, short, byte, Byte, BigDecimal , BigInteger or String. The Short variable aa is converted to the type matching xxxx, i.e. double, Double, float, Float, long, Long, int, Integer, Short, byte, Byte, BigDecimal, BigInteger or String, which is returned to bb

Conversion of byte
public static double convert_byte_to_double(byte xx)
public static Double convert_byte_to_Double(byte xx)
public static float convert_byte_to_float(byte xx)
public static Float convert_byte_to_Float(byte xx)
public static long convert_byte_to_long(byte xx)
public static Long convert_byte_to_Long(byte xx)
public static int convert_byte_to_int(byte xx)
public static Integer convert_byte_to_Integer(byte xx)
public static short convert_byte_to_short(byte xx)
public static Short convert_byte_to_Short(byte xx)
public static Byte convert_byte_to_Byte(byte xx)
public static BigDecimal convert_byte_to_BigDecimal(byte xx)
public static BigIntegral convert_byte_to_BigIntegral(byte xx)

General usage:                      bb = Conv.convert_byte_to_xxxx(aa);
where xxxx may be double, Double, float, Float, long, Long, int, Integer, short, Short, Byte, BigDecimal, BigInteger or String. The byte variable aa is converted to the type matching xxxx, i.e. double, Double, float, Float, long, Long, int, Integer, short, Short, Byte, BigDecimal, BigInteger or String, which is returned to bb

Conversion of Byte
public static double convert_Byte_to_double(Byte xx)
public static Double convert_Byte_to_Double(Byte xx)
public static float convert_Byte_to_float(Byte xx)
public static Float convert_Byte_to_Float(Byte xx)
public static long convert_Byte_to_long(Byte xx)
public static Long convert_Byte_to_Long(Byte xx)
public static int convert_Byte_to_int(Byte xx)
public static Integer convert_Byte_to_Integer(Byte xx)
public static short convert_Byte_to_short(Byte xx)
public static Short convert_Byte_to_Short(Byte xx)
public static byte convert_Byte_to_byte(Byte xx)
public static BigDecimal convert_Byte_to_BigDecimal(Byte xx)
public static BigIntegral convert_Byte_to_BigIntegral(Byte xx)

General usage:                      bb = Conv.convert_Byte_to_xxxx(aa);
where xxxx may be double, Double, float, Float, long, Long, int, Integer, short, Short, byte, BigDecimal, BigInteger or String. The Byte variable aa is converted to the type matching xxxx, i.e. double, Double, float, Float, long, Long, int, Integer, short, Short, byte, BigDecimal, BigInteger or String, which is returned to bb

Conversion of BigDecimal
public static double convert_BigDecimal_to_double(BigDecimal xx)
public static Double convert_BigDecimal_to_Double(BigDecimal xx)
public static float convert_BigDecimal_to_float(BigDecimal xx)
public static Float convert_BigDecimal_to_Float(BigDecimal xx)
public static long convert_BigDecimal_to_long(BigDecimal xx)
public static Long convert_BigDecimal_to_Long(BigDecimal xx)
public static int convert_BigDecimal_to_int(BigDecimal xx)
public static Integer convert_BigDecimal_to_Integer(BigDecimal xx)
public static short convert_BigDecimal_to_short(BigDecimal xx)
public static Short convert_BigDecimal_to_Short(BigDecimal xx)
public static byte convert_BigDecimal_to_byte(BigDecimal xx)
public static Byte convert_BigDecimal_to_Byte(BigDecimal xx)
public static BigIntegral convert_BigDecimal_to_BigIntegral(BigDecimal xx)

General usage:                      bb = Conv.convert_BigDecimal_to_xxxx(aa);
where xxxx may be double, Double, float, Float, long, Long, int, Integer, short, Short, byte, Byte, BigInteger or String. The BigDecimal variable aa is converted to the type matching xxxx, i.e. double, Double, float, Float, long, Long, int, Integer, short, Short, byte, Byte, BigInteger or String, which is returned to bb

Conversion of BigInteger
public static double convert_BigInteger_to_double(BigInteger xx)
public static Double convert_BigInteger_to_Double(BigInteger xx)
public static float convert_BigInteger_to_float(BigInteger xx)
public static Float convert_BigInteger_to_Float(BigInteger xx)
public static long convert_BigInteger_to_long(BigInteger xx)
public static Long convert_BigInteger_to_Long(BigInteger xx)
public static int convert_BigInteger_to_int(BigInteger xx)
public static Integer convert_BigInteger_to_Integer(BigInteger xx)
public static short convert_BigInteger_to_short(BigInteger xx)
public static Short convert_BigInteger_to_Short(BigInteger xx)
public static byte convert_BigInteger_to_byte(BigInteger xx)
public static Byte convert_BigInteger_to_Byte(BigInteger xx)
public static BigDecimal convert_BigInteger_to_BigDecimal(BigInteger xx)

General usage:                      bb = Conv.convert_BigInteger_to_xxxx(aa);
where xxxx may be double, Double, float, Float, long, Long, int, Integer, short, Short, byte, Byte, BigDecimal or String. The BigInteger variable aa is converted to the type matching xxxx, i.e. double, Double, float, Float, long, Long, int, Integer, short, Short, byte, Byte, BigDecimal or String, which is returned to bb

Conversion of String
public static double convert_String_to_double(String xx)
public static Double convert_String_to_Double(String xx)
public static float convert_String_to_float(String xx)
public static Float convert_String_to_Float(String xx)
public static long convert_String_to_long(String xx)
public static Long convert_String_to_Long(String xx)
public static int convert_String_to_int(String xx)
public static Integer convert_String_to_Integer(String xx)
public static short convert_String_to_short(String xx)
public static Short convert_String_to_Short(String xx)
public static byte convert_String_to_byte(String xx)
public static Byte convert_String_to_Byte(String xx)
public static BigDecimal convert_String_to_BigDecimal(String xx)
public static BigInteger convert_String_to_BigInteger(String xx)
public static String toTitleCase(String xx)

General usage:                      bb = Conv.convert_String_to_xxxx(aa);
where xxxx may be double, Double, float, Float, long, Long, int, Integer, short, Short, byte, Byte, BigDecimal or BigInteger. The String variable aa is converted to the type matching xxxx, i.e. double, Double, float, Float, long, Long, int, Integer, short, Short, byte, Byte, BigDecimal or BigInteger, which is returned to bb. BigDecimal is converted to the engineering format representation of a floating point number.

General usage:                      bb = Conv.toTitleCase(aa);
The String aa is converted to a title case String bb in which the initial letter of each word (token) is upper case and all following characters in the word are lower case. Any leading spaces, any trailing spaces and all the spaces between words are retained.

Conversion of char
public static double convert_char_to_double(char xx)
public static Double convert_char_to_Double(char xx)
public static float convert_char_to_float(char xx)
public static Float convert_char_to_Float(char xx)
public static long convert_char_to_long(char xx)
public static Long convert_char_to_Long(char xx)
public static int convert_char_to_int(char xx)
public static Integer convert_char_to_Integer(char xx)
public static short convert_char_to_short(char xx)
public static Short convert_char_to_Short(char xx)
public static byte convert_char_to_byte(char xx)
public static Byte convert_char_to_Byte(char xx)
public static BigIntegral convert_char_to_BigDecimal(char xx)
public static char convert_char_to_BigInteger(char xx)
public static char convert_char_to_String(char xx)

General usage:                      bb = Conv.convert_String_to_xxxx(aa);
where xxxx may be double, Double, float, Float, long, Long, int, Integer, short, Short, byte, Byte, BigDecimal, BigInteger or String. The String variable aa is converted to the type matching xxxx, i.e. double, Double, float, Float, long, Long, int, Integer, short, Short, byte, Byte, BigDecimal, BigInteger or String, which is returned to bb.

Complex to Phasor
public static Phasor convert_Complex_to_Phasor(Complex xx)

Usage:                      bb = Conv.convert_Complex_to_Phasor(aa);
Converts the Complex variable aa to a Phasor variable, bb.

Phasor to Complex
public static Complex convert_Phasor_to_Complex(Phasor xx)

Usage:                      bb = Conv.convert_Phasor_to_Complex(aa);
Converts the Phasor variable aa to a Complex variable, bb.



DECIMAL, HEXADECIMAL AND BINARY INTERCONVERSIONS

These methods operate only on integer numbers. Decimal integer numbers are of type long but may also be entered as type int. Hexadecimal and binary integer numbers are both of type String.

Decimal to Hexadecimal
public static String decToHex(long xx)
public static String decToHex(int xx)
public static String decToHex()

Usage:                      bb = Conv.decToHex(aa);
Converts the integer decimal number, aa, to the integer hexadecimal number, bb. The integer decimal number, aa, may be entered as either an int or a long.

Usage:                      bb = Conv.decToHex();
Converts the integer decimal number entered via a dialogue box, displayed upon calling decToHex(), to the integer hexadecimal number, bb.

Decimal to Binary
public static String decToBin(long xx)
public static String decToBin(int xx)
public static String decToBin()

Usage:                      bb = Conv.decToBin(aa);
Converts the integer decimal number, aa, to the integer binary number, bb. The integer decimal number, aa, may be entered as either an int or a long.

Usage:                      bb = Conv.decToBin();
Converts the integer decimal number entered via a dialogue box, displayed upon calling decToBin(), to the integer binary number, bb.

Hexadecimal to Decimal
public static long hexToDec(String xx)
public static long hexToDec()

Usage:                      bb = Conv.hexToDec(aa);
Converts the integer hexadecimal number, aa, to the integer decimal number, bb.

Usage:                      bb = Conv.hexToDec();
Converts the integer hexadecimal number entered via a dialogue box, displayed upon calling hexToDec(), to the integer decimal number, bb.

Hexadecimal to Binary
public static String hexToBin(String xx)
public static String hexToBin()

Usage:                      bb = Conv.hexToBin(aa);
Converts the integer hexadecimal number, aa, to the integer binary number, bb.

Usage:                      bb = Conv.hexToBin();
Converts the integer hexadecimal number entered via a dialogue box, displayed upon calling hexToBin(), to the integer binary number, bb.

Binary to Decimal
public static long binToDec(String xx)
public static long binToDec()

Usage:                      bb = Conv.binToDec(aa);
Converts the integer binary number, aa, to the integer decimal number, bb.

Usage:                      bb = Conv.binToDec();
Converts the integer binary number entered via a dialogue box, displayed upon calling binToDec(), to the integer decimal number, bb.

Binary to Hexadecimal
public static String binToHex(String xx)
public static String binToHex()

Usage:                      bb = Conv.binToHex(aa);
Converts the integer binary number, aa, to the integer hexadecimal number, bb.

Usage:                      bb = Conv.binToHex();
Converts the integer binary number entered via a dialogue box, displayed upon calling binToHex(), to the integer hexadecimal number, bb.





PHYSICAL UNIT CONVERSION FUNCTIONS

Radians to degrees
public static double radToDeg(double rad)
Usage:                      deg = Conv.radToDeg(rad);
Converts the argument, rad in radians, to degrees and returns that value in degrees. Performs the same function as the java.lang.Math Math.toDegrees(rad)

Degrees to radians
public static double degToRad(double deg)
Usage:                      rad = Conv.degToRad(deg);
Converts the argument, deg in degrees, to radians and returns that value in radians. Performs the same function as the java.lang.Math Math.toRadians(deg)

Frequency (Hz) to radial frequency
public static double frequencyToRadialFrequency(double freq)
Usage:                      radial = Conv.frequencyToRadialFrequency(freq);
Converts the argument, freq, a frequency in Hz, to the corresponding radial frequency and returns that value in radians per second.

Radial frequency to frequency
public static double radialfrequencyToFrequency(double rad)
Usage:                      freq = Conv.radialFrequencyToFrequency(rad);
Converts the argument, rad, a radial frequency in radians per second, to the corresponding frequency and returns that value in Hz.

Electron volts to wavelength
public static double evToNm(double v)
Usage:                      lambda = Conv.evToNm(volt);
Returns the wavelength, in nanometres, of a photon corresponding, in energy, to the equivalent electron volt energy.

Wavelength to electron volts
public static double nmToEv(double v)
Usage:                      volt = Conv.nmToEv(lambda);
Returns the value, in electron volts, of the energy of a photon with a wavelength, in nanometres, of lambda.

Molar to %w/v
public static double molarToPercentWeightByVol(double molar, double molWeight)
Usage:                      percent = Conv.molarToPercentWeightByVol(molar, molWeight);
Returns the percentage weight by volume concentration, i.e. grams of solute per 100 ml of solution, for a given molar concentration (argument molar in the above usage) of a solute of molecular weight, molWeight, in the above usage.

%w/v to molar
public static double percentWeightByVolToMolar(double percent, double molWeight)
Usage:                      molar = Conv.percentWeightByVolToMolar(percent, molWeight);
Returns the molar concentration, i.e. moles per litre, for a given percentage weight by volume concentration, i.e. grams of solute per 100 ml of solution, (argument percent in the above usage) of a solute of molecular weight, molWeight, in the above usage.

Date and time to milliseconds since 0 hours 0 minutes 0 seconds on 1 Jan 1970 (computer time)
public static long dateToJavaMilliSecondsUK(int year, int month, int dayOfTheMonth, String dayOfTheWeek, int hour, int min, int sec, int millisec)
Usage:                      compTime = Conv.dateToJavaMilliSecondsUK(2009, 9, 27, "Sunday", 15, 32, 7, 0);
Converts the date (e.g. 3.32 pm and 7 seconds and 0 milliseconds, on Sunday, 27th September 2009 (27.09.09) in the above example) to the Java time scale, i.e. millisecond since 0 hours 0 minutes 0 seconds on 1 Jan 1970. This method corrects for UK summer time. The days of the week should be entered as the String "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday" or "Saturday".

Height and weight to Body Mass Index (BMI) [metric]
public static double calcBMImetric(double height, double weight)
Usage:                      bmi = Conv.calcBMImetric(height, weight);
Returns the Body Mass Index (BMI) for a height in metres and a weight in kilograms.

Height and weight to Body Mass Index (BMI) [imperial]
public static double calcBMIimperial(double height, double weight)
Usage:                      bmi = Conv.calcBMIimperial(height, weight);
Returns the Body Mass Index (BMI) for a height in feet and a weight in pounds.

Body Mass Index (BMI) and height to weight [metric]
public static double calcWeightFromBMImetric(double bmi, double height)
Usage:                      bmi = Conv.calcWeightFromBMImetric(bmi, height);
Returns the weight in kilograms for a height in metres and Body Mass Index (BMI).

Body Mass Index (BMI) and height to weight [imperial]
public static double calcWeightFromBMIimperial(double bmi, double height)
Usage:                      bmi = Conv.calcWeightFromBMImetric(bmi, height);
Returns the weight in pounds for a height in ft and Body Mass Index (BMI).

Degrees Celsius to degrees Kelvin
public static double celciusToKelvin(double cels)
Usage:                      deg = Conv.celsiusToKelvin(cels);

Degrees Kelvin to degrees Celsius
public static double kelvinToCelsius(double kelv)
Usage:                      deg = Conv.kelvinToCelsius(kelv);

Degrees Celsius to degrees Fahrenheit
public static double celciusToFahren(double cels)
Usage:                      deg = Conv.celsiusToFahren(cels);

Degrees Fahrenheit to degrees Celsius
public static double fahrenToCelsius(double kelv)
Usage:                      deg = Conv.fahrenToCelsius(fahr);

Calories to joules
public static double calorieToJoule(double cal)
Usage:                      en = Conv.calorieToJoule(cal);

Joules to calories
public static double jouleToCalorie(double joule)
Usage:                      en = Conv.jouleToCalorie(joule);

Grams to ounces
public static double gramToOunce(double gm)
Usage:                      oz = Conv.gramToOunce(gm);

Ounces to grams
public static double ounceToGram(double oz)
Usage:                      gm = Conv.ounceToGram(oz);

Kilograms to pounds
public static double kgToPound(double kg)
Usage:                      pd = Conv.kgToPound(kg);

Pounds to kilograms
public static double poundToKg(double pd)
Usage:                      kg = Conv.poundToKg(oz);

Kilograms to tons (UK)
public static double kgToTon(double kg)
Usage:                      tons = Conv.kgToTon(kg);

Tons (UK) to kilograms
public static double tonToKg(double ton)
Usage:                      kg = Conv.tonToKg(ton);

Millimetres to inches
public static double millimetreToInch(double mm)
Usage:                      in = Conv.millimetreToInch(mm);

Inches to millimetres
public static double inchToMillimetre(double in)
Usage:                      mm = Conv.inchToMillimetre(in);

Metres to feet
public static double metreToFoot(double metre)
Usage:                      ft = Conv.metreToFoot(metre);

Feet to metres
public static double footToMetre(double ft)
Usage:                      metre = Conv.footToMetre(ft);

Metres to yards
public static double metreToYard(double metre)
Usage:                      yd = Conv.metreToYard(metre);

Yards to metres
public static double yardToMetre(double yd)
Usage:                      metre = Conv.yardToMetre(yd);

Kilometres to miles
public static double kmToMile(double km)
Usage:                      mile = Conv.kmToMile(km);

Miles to kilometres
public static double mileToKm(double mile)
Usage:                      km = Conv.mileToKm(mile);

UK gallons to litres
public static double gallonToLitre(double gall)
Usage:                      litre = Conv.gallonToLitre(gall);

Litres to UK gallons
public static double litreToGallon(double litre)
Usage:                      gall = Conv.litreToGallon(litre);

UK quarts to litres
public static double quartToLitre(double quart)
Usage:                      litre = Conv.quartToLitre(quart);

Litres to UK quarts
public static double litreToQuart(double litre)
Usage:                      quart = Conv.litreToQuart(litre);

UK pints to litres
public static double pintToLitre(double pint)
Usage:                      litre = Conv.pintToLitre(pint);

Litres to UK pints
public static double litreToPint(double litre)
Usage:                      pint = Conv.litreToPint(litre);

Fuel Consumption: UK Gallons per mile to litres per kilometre
public static double gallonPerMileToLitrePerKm(double gallPmile)
Usage:                      litrePkm = Conv.gallonPerMileToLitrePerKm(gallPmile);

Fuel Consumption: Litres per kilometre to UK gallons per mile
public static double litrePerKmToGallonPerMile(double litrePkm)
Usage:                      gallPmile = Conv.litrePerKmToGallonPerMile(litrePkm);

Fuel Consumption: miles per UK Gallon to kilometres per litre
public static double MilePerGallonToKmPerLitre(double milePgall)
Usage:                      kmPlitreP = Conv.milePerGallonToKmPerLitre(milePgall);

Fuel Consumption: Kilometres per litres to miles per UK gallon
public static double kmPerLitreToMilePerGallon(double kmPlitre)
Usage:                      milePgall = Conv.kmPerLitreToMilePerGallon(kmPlitre);

UK fluid ounce to American fluid ounce
public static double fluidOunceUKtoUS(double flozUK)
Usage:                      flozUS = Conv.fluidOunceUKtoUS(flozUK);

American fluid ounce to UK fluid ounce
public static double fluidOunceUStoUK(double flozUK)
Usage:                      flozUK = Conv.fluidOunceUStoUK(flozUS);

UK pint to American liquid pint
public static double pintUKtoUS(double pintUK)
Usage:                      pintUS = Conv.pintUKtoUS(pintUK);

American liquid pint to UK pint
public static double pintUStoUK(double pintUK)
Usage:                      pintUK = Conv.pintUStoUK(pintUS);

UK quart to American liquid quart
public static double quartUKtoUS(double quartUK)
Usage:                      quartUS = Conv.quartUKtoUS(quartUK);

American liquid quart to UK quart
public static double quartUStoUK(double quartUK)
Usage:                      quartUK = Conv.quartUStoUK(quartUS);

UK gallon to American gallon
public static double gallonUKtoUS(double gallonUK)
Usage:                      gallonUS = Conv.gallonUKtoUS(gallonUK);

American gallon to UK gallon
public static double gallonUStoUK(double gallonUS)
Usage:                      gallonUK = Conv.gallonUStoUK(gallonUS);

UK pint to American cup
public static double pintUKtoCupUS(double pintUK)
Usage:                      cupUS = Conv.pintUKtoCupUS(pintUK);

American cup to UK pint
public static double cupUStoPintUK(double cupUS)
Usage:                      pintUK = Conv.cupUStoPintUK(cupUS);




OTHER CLASSES USED BY THIS CLASS

This class uses the following classes in this library:


PERMISSION TO COPY

Permission to use, copy and modify this software and its documentation for NON-COMMERCIAL purposes is granted, without fee, provided that an acknowledgement to the author, Dr Michael Thomas Flanagan at www.ee.ucl.ac.uk/~mflanaga, appears in all copies and associated documentation or publications. Dr Michael Thomas Flanagan makes no representations about the suitability or fitness of the software for any or for a particular purpose. Dr Michael Thomas Flanagan shall not be liable for any damages suffered as a result of using, modifying or distributing this software or its derivatives.

Redistributions of the source code of this class, or parts of the source codes, must retain the copyright notice, this list of conditions and the following disclaimer (all at the top of the source code) and requires written permission from the Michael Thomas Flanagan:

Redistribution in binary form of all or parts of this class must reproduce the copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution and requires written permission from the Michael Thomas Flanagan:
.



This page was prepared by Dr Michael Thomas Flanagan