mirror of
https://github.com/youzan/vant.git
synced 2025-10-22 20:04:09 +00:00
chore: using includes instead of indexOf (#8261)
This commit is contained in:
@@ -190,7 +190,7 @@ export default createComponent({
|
||||
let formatted = formatNumber(String(value), !props.integer);
|
||||
|
||||
// limit max decimal length
|
||||
if (isDef(decimalLength) && formatted.indexOf('.') !== -1) {
|
||||
if (isDef(decimalLength) && formatted.includes('.')) {
|
||||
const pair = formatted.split('.');
|
||||
formatted = `${pair[0]}.${pair[1].slice(0, +decimalLength)}`;
|
||||
}
|
||||
|
Reference in New Issue
Block a user