Documentation of 'tig.Formats' Java class
Formats
tig

Class Formats



  • public class Formats
    extends java.lang.Object
    Class containing constants and static methods for formatting outputs.
    Called Formats to distinguish from java.text.Format.
    • Field Summary

      Fields 
      Modifier and Type Field and Description
      static java.lang.String DEG 
      static java.lang.String MINUS 
      static java.lang.String MINUT 
      static java.lang.String SECOND 
      static java.lang.String ZERO 
    • Constructor Summary

      Constructors 
      Constructor and Description
      Formats() 
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method and Description
      static java.lang.String addZero(int nb)
      Formats a integer to a 2 character long String.
      static java.lang.String doubleToDMS(double x)
      Expresses a number in format "DMS" (degrees, minuts, seconds).
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Formats

        public Formats()
    • Method Detail

      • doubleToDMS

        public static java.lang.String doubleToDMS(double x)
        Expresses a number in format "DMS" (degrees, minuts, seconds).
        For example, 186.5 will be transformed to 186 deg 30 prime 00" ;
        -6.5 will be transformed to -6 degree 30 prime 00".
        Warning : x must be reduced to its correct interval (ex [0, 360[) before calling this method.
        Parameters:
        x - any number.
        Returns:
        x expressed in "DMS" format.
      • addZero

        public static java.lang.String addZero(int nb)
        Formats a integer to a 2 character long String. Useful for date formatting.
        Parameters:
        nb - integer number to format.
        Returns:
        A String representation of nb :
      • if 0 <= nb <= 9, "0" followed by the digit ;
      • if 10 <= nb <= 99, the two digits ;
      • if nb < 0 or nb > 100, the String "xx".

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.