## UnitFormat(value, unit, config)

单位进制工具类

#### new UnitFormat(value, unit, config)

  单位进制换算公共方法

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `value` | number | 数值
  `unit` | unit | 单位
  `config` | object | 配置

### Methods

#### checkConfig(config) → {Object}

  适配配置项

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `config` |  |

  ##### Returns:

  Object

#### checkUnitType(unit) → {boolean}

  检查单位是否符合要求

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `unit` |  |

  ##### Returns:

  boolean

#### formatTimestamp(formatStr) → {string}

  格式化日期字符串

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `formatStr` | string | 格式化日期字符串 例：YYYY-MM-DD HH:mm:ss

  ##### Returns:

  string

#### setError(unit, errorKey, info, isLog) → {Object}

  输入错误时设置错误的返回值

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `unit` |  |
  `errorKey` |  |
  `info` |  |
  `isLog` |  |

  ##### Returns:

  Object

#### unitToUnit(newUnit) → {object}

  相同单位互相转换

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `newUnit` | unit | 转换目的单位

  ##### Returns:

  object