pretty print subdollar values for sku costs
This commit is contained in:
@@ -20,7 +20,7 @@ import { Table, TableColumn } from '@backstage/core';
|
||||
import { Dialog, IconButton, Typography } from '@material-ui/core';
|
||||
import { default as CloseButton } from '@material-ui/icons/Close';
|
||||
import { CostGrowthIndicator } from '../CostGrowth';
|
||||
import { currencyFormatter, formatPercent } from '../../utils/formatters';
|
||||
import { costFormatter, formatPercent } from '../../utils/formatters';
|
||||
import { useEntityDialogStyles as useStyles } from '../../utils/styles';
|
||||
import { BarChartOptions, Entity } from '../../types';
|
||||
|
||||
@@ -38,7 +38,7 @@ function createRenderer(col: keyof RowData, classes: Record<string, string>) {
|
||||
case 'current':
|
||||
return (
|
||||
<Typography className={rowStyles}>
|
||||
{currencyFormatter.format(row[col])}
|
||||
{costFormatter.format(row[col])}
|
||||
</Typography>
|
||||
);
|
||||
case 'ratio':
|
||||
|
||||
@@ -24,6 +24,11 @@ export type Period = {
|
||||
periodEnd: string;
|
||||
};
|
||||
|
||||
export const costFormatter = new Intl.NumberFormat('en-US', {
|
||||
style: 'currency',
|
||||
currency: 'USD',
|
||||
});
|
||||
|
||||
export const currencyFormatter = new Intl.NumberFormat('en-US', {
|
||||
style: 'currency',
|
||||
currency: 'USD',
|
||||
|
||||
Reference in New Issue
Block a user