summaryrefslogtreecommitdiffstats
path: root/sdc-workflow-designer-ui/src/app/paletx/core/number-wrapper-parse.ts
blob: ceccd92e5cea7918d23ba9b930a9e7e876eb4ae2 (plain)
1
2
3
4
5
6
7
8
9
10
/* tslint:disable:array-type member-access variable-name */
export function NumberWrapperParseFloat(text: any) {
  if (/^(\-|\+)?[0-9]+$/.test(text)) {
	return parseInt(text);
  } else if (/^(\-|\+)?[0-9]+\.[0-9]+$/.test(text)) {
	return parseFloat(text);
  } else {
	return 0;
  }
}