fix(instances): make all prices 4 decimal points

This commit is contained in:
Sara Vieira 2018-03-20 10:52:55 +00:00
parent 55d5d24475
commit 06d8cd7de6
2 changed files with 4 additions and 2 deletions

View File

@ -1264,7 +1264,7 @@ exports[`renders <Package /> without throwing 1`] = `
name="td" name="td"
selected={false} selected={false}
> >
1 1.0000
</td> </td>
</tr> </tr>
`; `;

View File

@ -36,6 +36,8 @@ const GroupIcons = {
COMPUTE: <CpuIcon fill="#8043DC" /> COMPUTE: <CpuIcon fill="#8043DC" />
}; };
const fourDecimals = n => parseFloat(Math.round(n * 10000) / 10000).toFixed(4);
const VerticalDivider = styled.div` const VerticalDivider = styled.div`
width: ${remcalc(1)}; width: ${remcalc(1)};
background: ${props => props.theme.grey}; background: ${props => props.theme.grey};
@ -166,7 +168,7 @@ export const Package = ({
</TableTd> </TableTd>
)} )}
<TableTd right bold={sortBy === 'price'} selected={selected}> <TableTd right bold={sortBy === 'price'} selected={selected}>
{price} {fourDecimals(price)}
</TableTd> </TableTd>
</TableTrActionable> </TableTrActionable>
); );