const getFloatFixedLen = (num: number | string) => num.toString()?.split('.')[1]?.length || 0; const getFixedFloat = (rawNum, fixedLength: number) => { const num = typeof rawNum === 'string' ? Number.parseFloat(rawNum) : rawNum; const fixedNum: string = num.toFixed(fixedLength); return parseFloat(fixedNum); }; export { getFixedFloat, getFloatFixedLen };