+
+ /**
+ * @param x number
+ * @param n number of decimals to get (defaults to 1, needs to be >= 1)
+ */
+ static getDecimalForNumber (x: number, n = 1) {
+ const v = x.toString().split('.')
+ const f = v[1] || ''
+ if (f.length > n) return +f.substring(0, n)
+ return +f
+ }
+
+ private dictionary: { max: number, type: string }[] = [