Skip to content

Home > resol-vbus-core > utils > Formatter

utils.Formatter class

A formatter helper class used in formatAndJoin.

Signature:

typescript
export declare class Formatter

Methods

Method

Modifiers

Description

datecode(timestamp)

Formats a Date into a UTC datecode representation ('YYYYMMDD').

dec(val, len)

Formats a number into its decimal representation.

dec2(val)

Formats a number into its decimal representation, padding it to a length of 2 digits.

dec4(val)

Formats a number into its decimal representation, padding it to a length of 4 digits.

hex(val, len)

Formats a number into its hexadecimal representation.

hex2(val)

Formats a 8 bit number into its hexdecimal representation.

hex4(val)

Formats a 16 bit number into its hexdecimal representation.

hex8(val)

Formats a 32 bit number into its hexdecimal representation.

timecode(timestamp)

Formats a Date into a UTC timecode representation ('HHMMSS').