mirror of
https://github.com/element-plus/element-plus.git
synced 2024-11-21 01:02:59 +08:00
fix(components): [statistic] fix excessive decimals when value is NAN (#17798)
fix(components): [statistic]Fix excessive decimals when value is NAN When the value is NAN, correct the display issue that shows unnecessary decimal points. closed #17784
This commit is contained in:
parent
8692965e80
commit
7c9414a3c7
@ -41,7 +41,8 @@ const displayValue = computed(() => {
|
||||
|
||||
if (isFunction(formatter)) return formatter(value)
|
||||
|
||||
if (!isNumber(value)) return value
|
||||
// https://github.com/element-plus/element-plus/issues/17784
|
||||
if (!isNumber(value) || Number.isNaN(value)) return value
|
||||
|
||||
let [integer, decimal = ''] = String(value).split('.')
|
||||
decimal = decimal
|
||||
|
Loading…
Reference in New Issue
Block a user