Add fixedNumber prop to ObjectProperty component for number formatting.
This commit is contained in:
parent
ab56a3abd4
commit
556b16a5dc
@ -87,6 +87,7 @@ const ObjectProperty = ({
|
||||
showPreview = true,
|
||||
options = [],
|
||||
roundNumber = false,
|
||||
fixedNumber = false,
|
||||
showHyperlink,
|
||||
showSince,
|
||||
properties = [],
|
||||
@ -272,6 +273,9 @@ const ObjectProperty = ({
|
||||
if (roundNumber != false && typeof value === 'number') {
|
||||
roundedValue = round(value, roundNumber)
|
||||
}
|
||||
if (fixedNumber != false && typeof value === 'number') {
|
||||
roundedValue = value.toFixed(fixedNumber)
|
||||
}
|
||||
|
||||
return (
|
||||
<Text {...textParams}>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user