numberUtil.js 348 B

123456789
  1. import { trimNumber, num2str } from '@rc-component/mini-decimal';
  2. export function getDecupleSteps(step) {
  3. var stepStr = typeof step === 'number' ? num2str(step) : trimNumber(step).fullStr;
  4. var hasPoint = stepStr.includes('.');
  5. if (!hasPoint) {
  6. return step + '0';
  7. }
  8. return trimNumber(stepStr.replace(/(\d)\.(\d)/g, '$1$2.')).fullStr;
  9. }