Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion src/components/SelectionList/Search/ReportListItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,17 @@ type ActionCellProps = {
function TotalCell({showTooltip, isLargeScreenWidth, reportItem}: ReportCellProps) {
const styles = useThemeStyles();

let total = reportItem?.total ?? 0;

// Only invert non-zero values otherwise we'll end up with -0.00
if (total) {
Comment thread
nkdengineer marked this conversation as resolved.
Resolved
total *= reportItem?.type === CONST.REPORT.TYPE.EXPENSE ? -1 : 1;
}

return (
<TextWithTooltip
shouldShowTooltip={showTooltip}
text={CurrencyUtils.convertToDisplayString((reportItem?.type === CONST.REPORT.TYPE.EXPENSE ? -1 : 1) * (reportItem?.total ?? 0), reportItem?.currency)}
text={CurrencyUtils.convertToDisplayString(total, reportItem?.currency)}
style={[styles.optionDisplayName, styles.textNormal, styles.pre, styles.justifyContentCenter, isLargeScreenWidth ? undefined : styles.textAlignRight]}
/>
);
Expand Down