fix(Stepper): incorrect value when format minus value (#6238)
This commit is contained in:
+1
-1
@@ -1,6 +1,6 @@
|
||||
// Utils
|
||||
import { formatNumber } from './utils';
|
||||
import { preventDefault } from '../utils/dom/event';
|
||||
import { formatNumber } from '../utils/format/number';
|
||||
import { resetScroll } from '../utils/dom/reset-scroll';
|
||||
import {
|
||||
createNamespace,
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
export function formatNumber(value: string, allowDot: boolean) {
|
||||
if (allowDot) {
|
||||
const dotIndex = value.indexOf('.');
|
||||
|
||||
if (dotIndex > -1) {
|
||||
value =
|
||||
value.slice(0, dotIndex + 1) + value.slice(dotIndex).replace(/\./g, '');
|
||||
}
|
||||
} else {
|
||||
value = value.split('.')[0];
|
||||
}
|
||||
|
||||
const regExp = allowDot ? /[^0-9.]/g : /\D/g;
|
||||
|
||||
return value.replace(regExp, '');
|
||||
}
|
||||
Reference in New Issue
Block a user