форматирование
This commit is contained in:
parent
ea9cb4a084
commit
601a125349
@ -1,6 +1,6 @@
|
|||||||
import { SearchOutlined } from '@ant-design/icons';
|
import { SearchOutlined } from '@ant-design/icons';
|
||||||
import { Button, Input, Space, Tree } from 'antd';
|
import { Button, Input, Space, Tree } from 'antd';
|
||||||
import { ReactNode, useEffect, useMemo, useState } from 'react';
|
import { type ReactNode, useEffect, useMemo, useState } from 'react';
|
||||||
import './TreeFilterDropdown.css';
|
import './TreeFilterDropdown.css';
|
||||||
|
|
||||||
export type OptionType = {
|
export type OptionType = {
|
||||||
@ -17,7 +17,7 @@ interface TreeFilterDropdownProps {
|
|||||||
selectedKeys: string[];
|
selectedKeys: string[];
|
||||||
onChange: (keys: string[]) => void;
|
onChange: (keys: string[]) => void;
|
||||||
onClose: () => void;
|
onClose: () => void;
|
||||||
warningBlock?: ReactNode
|
warningBlock?: ReactNode;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const TreeFilterDropdown: React.FC<TreeFilterDropdownProps> = ({
|
export const TreeFilterDropdown: React.FC<TreeFilterDropdownProps> = ({
|
||||||
|
|||||||
@ -1,8 +1,4 @@
|
|||||||
export const chessTableCellFormatValue = (
|
export const chessTableCellFormatValue = (val: string | number | null | undefined, units: string, decimals: number) => {
|
||||||
val: string | number | null | undefined,
|
|
||||||
units: string,
|
|
||||||
decimals: number
|
|
||||||
) => {
|
|
||||||
if (val === undefined || val === null || val === '') return '';
|
if (val === undefined || val === null || val === '') return '';
|
||||||
|
|
||||||
let strVal = String(val);
|
let strVal = String(val);
|
||||||
@ -46,7 +42,7 @@ export const chessTableCellFormatValue = (
|
|||||||
maximumFractionDigits: decimals,
|
maximumFractionDigits: decimals,
|
||||||
}).format(strVal as any);
|
}).format(strVal as any);
|
||||||
|
|
||||||
const zeroString = `0${decimals > 0 ? ',' + '0'.repeat(decimals) : ''}`;
|
const zeroString = `0${decimals > 0 ? `,${'0'.repeat(decimals)}` : ''}`;
|
||||||
if (formatted === `-${zeroString}`) {
|
if (formatted === `-${zeroString}`) {
|
||||||
return zeroString;
|
return zeroString;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -18,7 +18,6 @@ interface ConsolidationChessTableI {
|
|||||||
isFullscreen?: boolean;
|
isFullscreen?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
type TotalRow = {
|
type TotalRow = {
|
||||||
id: string;
|
id: string;
|
||||||
name: string;
|
name: string;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user