com.ihr.xbrl.om.instance.unit

## Class UnitToString

- java.lang.Object
- - com.ihr.xbrl.om.instance.unit.UnitToString

-     public class UnitToString
      extends java.lang.Object

  The Class UnitToString.
  Author:
    Ignacio

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `UnitToString()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static java.lang.String` | `getUnitHtml(XBRLUnit unit)` Works identically as `getUnitString(XBRLUnit)` except that the returned string is HTML code that can be used for tooltips.
    `static java.lang.String` | `getUnitString(XBRLUnit unit)` This static method returns the representation character for an XBRL Unit.
    `static java.lang.String` | `getUnitSymbol(javax.xml.namespace.QName q)` Returns a text string representing the symbol for this unit or null if no one is set.

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### UnitToString

          public UnitToString()

  - ### Method Detail

    - #### getUnitSymbol

          public static java.lang.String getUnitSymbol(javax.xml.namespace.QName q)

      Returns a text string representing the symbol for this unit or null if no one is set.

      It is possible adding more symbols in an XML file that is a resource read by this class the first time the class is instantiated.

      Parameters:
        `q` - the q
      Returns:
        the unit symbol

    - #### getUnitString

          public static java.lang.String getUnitString(XBRLUnit unit)

      This static method returns the representation character for an XBRL Unit.

      If the unit is a simple unit, then the representation is the unit character or an string that represents the monetary unit. for example "$" is returned for iso4017:USD and "CLP" is returned for iso4217:CLP

      If the unit is composed by a set of units in the numerator then a string representing the product of the units is returned. Example iso4217:USD,iso4217:CLP would return "$ × CLP".

      If the unit has numerator units and denominator units the division character "/" is put in the position required to make the unit representation meaningful.

      Parameters:
        `unit` - XBRLUnit object
      Returns:
        String

    - #### getUnitHtml

          public static java.lang.String getUnitHtml(XBRLUnit unit)

      Works identically as `getUnitString(XBRLUnit)` except that the returned string is HTML code that can be used for tooltips.
      Parameters:
        `unit` - XBRLUnit
      Returns:
        String with HTML code
      See Also:
        `getUnitString(XBRLUnit)`