mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-18 05:40:31 +00:00
fix: numeric values formating.
This commit is contained in:
@@ -59,6 +59,7 @@ export default function TableCell({ cell, row, index }) {
|
||||
className: classNames(cell.column.className, 'td', {
|
||||
'is-text-overview': cell.column.textOverview,
|
||||
'clickable': cell.column.clickable,
|
||||
'align-right': cell.column.align === 'right',
|
||||
}),
|
||||
onClick: handleCellClick,
|
||||
})}
|
||||
|
||||
@@ -14,7 +14,9 @@ function TableHeaderCell({ column, index }) {
|
||||
return (
|
||||
<div
|
||||
{...column.getHeaderProps({
|
||||
className: classNames(column.className || '', 'th'),
|
||||
className: classNames(column.className || '', 'th', {
|
||||
'align-right': column.align === 'right',
|
||||
}),
|
||||
})}
|
||||
>
|
||||
<If condition={expandable && index + 1 === expandToggleColumn}>
|
||||
@@ -32,7 +34,7 @@ function TableHeaderCell({ column, index }) {
|
||||
{...column.getSortByToggleProps({
|
||||
className: classNames('cell-inner', {
|
||||
'text-overview': column.textOverview,
|
||||
})
|
||||
}),
|
||||
})}
|
||||
>
|
||||
{column.render('Header')}
|
||||
|
||||
10
client/src/components/Utils/FormatNumber.js
Normal file
10
client/src/components/Utils/FormatNumber.js
Normal file
@@ -0,0 +1,10 @@
|
||||
import React from 'react';
|
||||
import { formattedAmount } from 'utils';
|
||||
|
||||
export function FormatNumber({ value, currency = '', noZero }) {
|
||||
return formattedAmount(value, currency, { noZero });
|
||||
}
|
||||
|
||||
export function FormatNumberCell({ value, column: { formatNumber } }) {
|
||||
return <FormatNumber value={value} {...formatNumber} />;
|
||||
}
|
||||
3
client/src/components/Utils/index.js
Normal file
3
client/src/components/Utils/index.js
Normal file
@@ -0,0 +1,3 @@
|
||||
|
||||
|
||||
export * from './FormatNumber';
|
||||
@@ -78,6 +78,8 @@ export * from './Dashboard';
|
||||
export * from './Drawer';
|
||||
export * from './Forms';
|
||||
export * from './MultiSelectTaggable'
|
||||
export * from './Utils/FormatNumber';
|
||||
|
||||
const Hint = FieldHint;
|
||||
|
||||
const T = FormattedMessage;
|
||||
|
||||
Reference in New Issue
Block a user