diff --git a/common/components/ui/UnitDisplay.tsx b/common/components/ui/UnitDisplay.tsx index 8ef88a50..5bfc5218 100644 --- a/common/components/ui/UnitDisplay.tsx +++ b/common/components/ui/UnitDisplay.tsx @@ -58,10 +58,16 @@ const UnitDisplay: React.SFC = params => { if (displayShortBalance) { const digits = - typeof displayShortBalance === 'number' && displayShortBalance; - formattedValue = digits - ? format(convertedValue, digits) - : format(convertedValue); + typeof displayShortBalance === 'number' ? displayShortBalance : 4; + formattedValue = format(convertedValue, digits); + // If the formatted value was too low, display something like < 0.01 + if ( + parseFloat(formattedValue) === 0 && + parseFloat(convertedValue) !== 0 + ) { + const padding = digits !== 0 ? `.${'0'.repeat(digits - 1)}1` : ''; + formattedValue = `< 0${padding}`; + } } else { formattedValue = convertedValue; }