    import Helpers from 'pvbid-sdk/src/utils/Helpers.js'

public class | source

# Helpers

## Static Method Summary

Static Public Methods
public static | calculateFormula(formula: *, valuesMap: *): * |
public static | confirmNumber(val: number | string | boolean, dflt: number): number Converts any value to a finite number. |
public static | evalExpression(formula: *, valueMap: *): * |
public static | isNumber(val: string | number): boolean Determines if value is a finite number. |
public static | parseFormulaArguments(formula: string): string[] Parse the variables referenced in a formula |
public static | validateFormula(formula: *, valuesMap: *): * FIXME don't think there is a good way to validate without just eval'ing with the variables substituted in. |

## Constructor Summary

Public Constructor
public | constructor() |

## Static Public Methods

### public static calculateFormula(formula: *, valuesMap: *): * source

#### Params:

Name | Type | Attribute | Description
formula | * |  |
valuesMap | * |  |

#### Return:

*

### public static confirmNumber(val: number | string | boolean, dflt: number): number source

Converts any value to a finite number. If the value can not be converted it will use the default value. Booleans are converted to 1 or 0.

#### Params:

Name | Type | Attribute | Description
val | number | string | boolean |  |

dflt

number

- optional
- default: 0

#### Return:

number

### public static evalExpression(formula: *, valueMap: *): * source

#### Params:

Name | Type | Attribute | Description
formula | * |  |
valueMap | * |  |

#### Return:

*

### public static isNumber(val: string | number): boolean source

Determines if value is a finite number.

#### Params:

Name | Type | Attribute | Description
val | string | number |  |

#### Return:

boolean

### public static parseFormulaArguments(formula: string): string[] source

Parse the variables referenced in a formula

#### Params:

Name | Type | Attribute | Description
formula | string |  |

#### Return:

string[] | Array of variables referenced in the formula

### public static validateFormula(formula: *, valuesMap: *): * source

FIXME don't think there is a good way to validate without just eval'ing with the variables substituted in.

#### Params:

Name | Type | Attribute | Description
formula | * |  |
valuesMap | * |  |

#### Return:

*

## Public Constructors

### public constructor() source