Zum Hauptinhalt springen

FormatHelper

Constructors​

Constructor​

new FormatHelper(): FormatHelper

Returns​

FormatHelper

Methods​

fit2length()​

static fit2length(value, length, side, wildcard): string

Fits a value to a specific length

Parameters​

value​

string

The value you want to fit

length​

number

The length of your result

side​

string

"r" or "l" for the side you want to append your wildcard

wildcard​

string

The character that will be append

Returns​

string


convertStringToNumber()​

static convertStringToNumber(strNum): number

Converts a string-value to a number-value

Parameters​

strNum​

string

is the number in a string format

Returns​

number


formatNumber()​

static formatNumber(number, decimals, dec_point, thousands_sep): string

Fits a Number to a specific format

Parameters​

number​

number

The number value

decimals​

number

The amount of decimal places

dec_point​

string

The decimal separator

thousands_sep​

string

The thousands separator

Returns​

string


convertNumberToString()​

static convertNumberToString(Num): string

Converts a number-value to a string-value

Parameters​

Num​

number

Number-value that will be converted to string

Returns​

string