feat: columns of type number/percent in the table are right-aligned

This commit is contained in:
chenos 2022-04-06 16:06:08 +08:00
parent dd79cb05bf
commit 592b45f5f7
2 changed files with 4 additions and 1 deletions

View File

@ -12,7 +12,7 @@ export const ReadPretty: React.FC<InputProps & InputNumberProps> = (props: any)
}
const precision = Math.max(getNumberPrecision(String(value)), getNumberPrecision(step));
return (
<div>
<div className={'nb-read-pretty-input-number'}>
{addonBefore}
{toFixed(String(value), '.', precision)}
{addonAfter}

View File

@ -100,6 +100,9 @@ export const components = {
css`
max-width: 300px;
white-space: nowrap;
.nb-read-pretty-input-number {
text-align: right;
}
`,
)}
/>