fix zero value number format
This commit is contained in:
parent
bb2b0201a7
commit
dbe7a60c0c
|
@ -415,7 +415,10 @@ const DetailedAreaOrBarChart: FunctionComponent<
|
|||
type="monotone"
|
||||
dataKey={yKey}
|
||||
stroke={
|
||||
calculateChartChange() >= 0
|
||||
calculateChartChange() === 0 ||
|
||||
isNaN(calculateChartChange())
|
||||
? COLORS.FGD4[theme]
|
||||
: calculateChartChange() >= 0
|
||||
? COLORS.UP[theme]
|
||||
: COLORS.DOWN[theme]
|
||||
}
|
||||
|
|
|
@ -11,6 +11,8 @@ export const formatNumericValue = (
|
|||
formattedValue = roundUp
|
||||
? roundValue(numberValue, decimals, true)
|
||||
: roundValue(numberValue, decimals)
|
||||
} else if (numberValue === 0) {
|
||||
formattedValue = numberValue.toFixed(decimals || 0)
|
||||
} else if (numberValue > -0.0000000001 && numberValue < 0.000000001) {
|
||||
formattedValue = numberValue.toExponential(3)
|
||||
} else if (Math.abs(numberValue) >= 1000) {
|
||||
|
|
Loading…
Reference in New Issue