diff --git a/components/form/decimalInput.js b/components/form/decimalInput.js index 16fffb4..a2f6edc 100644 --- a/components/form/decimalInput.js +++ b/components/form/decimalInput.js @@ -68,12 +68,13 @@ export default function Input({label, prefix, numDecimals, error, hint, name, va } const filledText = ((prefix + ' ') || '') - + (Math.floor(currentValue) || '0') + + (currentValue !== 0 ? Math.floor(currentValue) : '') + (currentDecimals >= 0 ? '.' : '') + (currentDecimals > 0 ? currentValue.toFixed(currentDecimals).split('.')[1] : '') const remainingText = - (currentDecimals < 0 ? '.' : '') + (currentValue === 0 ? '0' : '') + + (currentDecimals < 0 ? '.' : '') + (numDecimals !== undefined && currentDecimals < numDecimals ? '0'.repeat(numDecimals - Math.max(currentDecimals, 0)) : '') return ( diff --git a/components/form/styles.module.css b/components/form/styles.module.css index bdada31..9c68e94 100644 --- a/components/form/styles.module.css +++ b/components/form/styles.module.css @@ -69,6 +69,7 @@ } .inputDecorators > span { + white-space: pre; display: inline-block; font: 400 13.3333px Arial; }